RE: gtkctree




On 19-Aug-98 Jonathan Blandford wrote:
>   I am writing an application that uses a ctree.  I would prefer it if
> nodes did not collapse/expand when double-clicked, and see no way to
> implement this without changing the ctree code.  Do people use this
> feature?

Yes, I use it. It's easier than aiming at a little hot-spot.
Stuart Parmenter ask for a ctree mode without any hot-spots. This mode can't
work without the double-click functionality. But it should be easy for you
to stop this event if you don't want it. Simply do something like :

...

   ctree = gtk_ctree_new_with_titles (2, 0, title);
   gtk_signal_connect (GTK_OBJECT (ctree), "button_press_event",
                       GTK_SIGNAL_FUNC (button_press), NULL);
...


gint button_press (GtkCTree *ctree, GdkEventButton *event, gpointer data)
{

...

  if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)   
     gtk_signal_emit_stop_by_name (GTK_OBJECT (ctree), "button_press_event");
 
...
}

> Would it be possible to make this an option, or remove it
> altogether (it's easy enough for applications to trap the double-click
> and collapse/expand on their own.)

I don't want to make it configurable, because in this case we have to make
all button events configurable. That would only make sense if we had something
like key-bindings for mouse buttons too.

bye,
  Lars



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