[gtkada] non-text widget in tree view column header

Rob Groen robgr at xs4all.nl
Mon May 20 14:35:16 CEST 2013


Hello,

After some trial-and-error I found a solution for the non-clickability  
of widgets in a tree view column.
Apparently, it has to do with the order in which you call Show_All. If 
Show_All on the column widget is called >before< a Show_All on the main 
window, then this column widget and its children will not get the 
signals. However, if you do a Show_All call on the column widget >after< 
Show_All on the main window, then the widgets can be activated and act 
visible on e.g. mouse over etc. Furthermore, sorting is distinguished 
when you click in the column in the empty space next to the column 
widget: the "clicked" on the column is activated and sorting happens, if 
that is what is enabled.

Best regards

Rob.

(PS I had this problem on both Unix and MSWindows systems)


On 18/05/13 16:21, Jan de Kruyf wrote:
>
> rob, hallo.
>
> I dont understand quite what you are doing (I am too new for that)  I 
> have only done some glade stuff
> which worked quite well once I understood the idiocyncracies of both 
> gtk and ada.
>
> But as a general rule I would say that
> 1. the outer window picks up the mouse from X (if it is linux you are 
> working with)
> 2. the outer window sends the mouse activity it got from X to one of 
> its children i.e. the area-occupant that holds title to the mouse 
> coordinates. Or perhaps it sends it to all children and the 
> area-occupant picks it up, while the others silently drop the message.
> 3. this child does the same and so on down the hierarchy,
> 4. until somewhere an action has been programmed for this mouse 
> activity (a handler has been connected)
>
> So if you dont get any action I would say one of 2 things:
> either your buttons are indeed not in the window hierarchy, as you say!
> or those buttons exist in there own right but are not connected to the 
> operating system (X again in the linux case) via a GtkWindow.
>
> So there is a parent child connection broken in the chain from X to 
> your buttons!
>
>
> j.
>
>
>
>
>
> On Sat, May 18, 2013 at 3:29 PM, Rob Groen <robgr at xs4all.nl 
> <mailto:robgr at xs4all.nl>> wrote:
>
>     I have a tree view of 1 column, that shows a list store with 2
>     columns, a string and a boolean. The tree view column has two
>     renderers, one for a toggle and one for text. In the header of the
>     column I have a checkbutton and a normal button (in stead of
>     normal text). I want to use the checkbutton in the column header
>     to toggle all the elements in the column. The normal button is to
>     be used to sort the column. (Note the a separate show or show_all
>     on these buttons is needed to display them as they are not part of
>     the window  hierarchy.)
>     The header is made clickable and reacts to the "clicked" signal of
>     the tree view column.
>     I have handlers connected to the "toggle" signal of the
>     checkbutton (in the header) and to the "clicked" signal of the
>     normal button (also in the header), but these handlers are never
>     called. If I specify the string column in the list store to be
>     used for sorting, sorting happens as expected and the "clicked"
>     handler on the column is called as well, but I want the sorting
>     and toggling actions to be separated.
>     Did I miss something? Is there way to achieve what I want, i.e.
>     get the right handler called ?
>
>     Regards,
>     Rob Groen
>
>
>
>     _______________________________________________
>     gtkada mailing list
>     gtkada at lists.adacore.com <mailto:gtkada at lists.adacore.com>
>     http://lists.adacore.com/mailman/listinfo/gtkada
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/gtkada/attachments/20130520/d9849e93/attachment.html>


More information about the gtkada mailing list