Popup menus on a tree view



Hello all,

I am trying to have a "button_press_event" callback on a treeview and searching through the archives I seem to find no mention of this being done. The eventbox_press_event is used to trigger a popup menu on a right click.
My code is as follows:

    /*
    make eventbox
    make treeview
    pack treeview in eventbox
    */
   
    gtk_widget_set_events(eventbox, GDK_BUTTON_PRESS_MASK);
    g_signal_connect(GTK_OBJECT(eventbox), "button_press_event",
            GTK_SIGNAL_FUNC(eventbox_press_event), ca);

then the eventbox_press_event works provided the treeview is empty.
as soon as the treeview has something put in it then my press_event stops getting called.  So i thought perhaps if i also:

    gtk_widget_add_events(treeview, GDK_BUTTON_PRESS_MASK);
    g_signal_connect(GTK_OBJECT(treeview), "button_press_event",
            GTK_SIGNAL_FUNC(eventbox_press_event), ca);

now the callback always works but the treeview no longer recieves mouse events, which i need to have happen as well.

I think its just that this is impossible am i missing something.  Personally i feel my option is just to include a modified tree view source in my program so that i can have this work.

thanks
todd



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