Hi,

 

I have implemented a menu button. On mouse event, the popup is happening
properly but I need to popup the menu during return key pressed event.

Is there something wrong in my code?

Is there any other way to do it?

 

Current implementation:

 

g_signal_connect_swapped (G_OBJECT(button_menu), "event", G_CALLBACK
(menu_pressed), G_OBJECT (menu));

 

static gboolean menu_pressed( GtkWidget *widget,

                              GdkEvent *event )

{

    if (event->type == GDK_BUTTON_PRESS) {

        GdkEventButton *bevent = (GdkEventButton *) event;

        gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL,

                        bevent->button, bevent->time);

        return TRUE;

    }

 

    return FALSE;

}

 

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to