[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Layer button backgrounds



On Fri, Aug 19, 2011 at 01:01:07PM +0100, Peter Clifton wrote:
> On Thu, 2011-08-18 at 18:57 -0700, Andrew Poelstra wrote:
> 
> > That is how I would like it to work. But clicking the swatch
> > also selects the layer, which is undesirable behavior. There
> > is no clean way to prevent this with a GtkTreeView widget.
> 
> Is there any dirty way to prevent it? ;)
> 

Yes, I found one -- and it is not actually that dirty. You can
intercept the button-press-event signal, use the function

  gtk_tree_view_get_path_at_pos ()

to figure out what cell is clicked on, then prevent the propagation
of the button-press-event if it was a swatch. (In this case, you
have to toggle the visibility in the tree model yourself.)

> I note that what you are trying to achieve is similar to the GIMP layers
> dialogue (with different icons), and you _can_ toggle visibility in GIMP
> without changing the active layer selection.
> 
> Hmm - looks at source..
> 
> gimp/app/widgets/gimplayertreeview.c
> 
> 14k-line re-implementation of gtk_tree_view.
> 
> 
> Given GTK was originally the "GIMP TOOL KIT", it seems sad that they
> have to go to such lengths to implement basic functionality.
> 
> 
> If we are really keen on the behaviour described - perhaps we could
> implement our own widget for it too.
>

It looks for now to be unnecessary. But I agree with your frustration
at the GIMP source rewriting half the toolkit.


-- 
Andrew Poelstra
Email: asp11 at sfu.ca OR apoelstra at wpsoftware.net
Web:   http://www.wpsoftware.net/andrew/



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user