GtkCList Double click woes



All,

I am working on some old legacy code that utilises the deprecated GtkCList widget. I need to extend this code so that a when a user double clicks on a row in the clist an action is taken. This legacy code also glade to define
the interface. The code in question is as follows:

Glade:
...
<signal name="click_column" handler="display_column_click" />
<signal name="button_press_event" handler="cache_button_press" after="yes"/>
...

C Handler:

bool cache_button_press(GtkWidget *widget, GdkEventButton *event, gpointer data)
{
    /* RIGHT CLICK */
    if (event->button == 3)
    {
        GtkWidget *menu;

        menu = new_widget_from_xml("cache_menu");
        gtk_menu_popup (GTK_MENU(menu), NULL, NULL, NULL, widget,
                            event->button, event->time);
    }

    /* LEFT DOUBLE CLICK */
    if (event->type == GDK_2BUTTON_PRESS && event->button == 1)
    {
        printf("Double click\n");
        cache_view();
    }
    return false;
}

In trying to follow the suggestion here: http://mail.gnome.org/archives/gtk-app-devel-list/2002-January/msg00058.html to get around the problem that double clicking clears the current selection in the clist, I am using the additional directive "after="yes"" in the signal handler declaration in the glade file.

Does this additional directive result in glade using g_signal_connect_after()
as apposed to g_signal_connect() when using glade_xml_signal_autoconnect()??

If so, I am finding that my signal handler is not getting called at all. What can I do?

If not, how does one go about facilitating double clicking in a GtkCList so that the selection is not cleared (considering I must use glade)??

Any and all help is greatly appreciated,
Timothy Cleaver






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