[gtkada] Disabling Tree Collapse-Expand signal during double-click

Emmanuel Briot briot at gnat.com
Fri Apr 6 11:07:32 CEST 2001


Jean-Etienne Doucet writes:
 > | I am using a double click on a file tree node to spawn an editing session on
 > | that file.  Does anyone know how I can effectively keep the tree node from
 > | collapsing/expanding on a Gdk_2button_Press event?  I am accomplishing that
 > | now by using Toggle_Expansion in my double-click callback, but the method is
 > | kind of ugly and it flickers as it quickly expands and collapses.  I need to
 > | keep the tree_expand and tree_collapse signal functionality for a selection
 > | (single-click).
 > | 
 > 
 > You should try a (function) callback that returns the boolean value True;
 > this keeps Gtk from executing its usual duty (e.g. collapse/expand) after
 > execution of your callback.


You might also want to simply block the propagation of the signal in your
callback by using a call similar to:

   Gtk.Handlers.Emit_Stop_By_Name (My_Tree, "select_row");

This is in fact a more general technics, that is always applicable, whereas the
function callback suggested by Jean-Etienne will only apply for some specific
signals.

Emmanuel




More information about the gtkada mailing list