Logo Search packages:      
Sourcecode: inkscape version File versions

void sp_event_root_menu_popup ( SPDesktop desktop,
SPItem item,
GdkEvent *  event 
)

Create popup menu and tell Gtk to show it.

Definition at line 1005 of file event-context.cpp.

Referenced by sp_event_context_private_item_handler(), and sp_event_context_private_root_handler().

{
    GtkWidget *menu;

    /* fixme: This is not what I want but works for now (Lauris) */
    if (event->type == GDK_KEY_PRESS) {
        item = sp_desktop_selection(desktop)->singleItem();
    }
    menu = sp_ui_context_menu(desktop, item);
    gtk_widget_show(menu);

    switch (event->type) {
        case GDK_BUTTON_PRESS:
            gtk_menu_popup(GTK_MENU(menu), NULL, NULL, 0, NULL, event->button.button, event->button.time);
            break;
        case GDK_KEY_PRESS:
            gtk_menu_popup(GTK_MENU(menu), NULL, NULL, 0, NULL, 0, event->key.time);
            break;
        default:
            break;
    }
}


Generated by  Doxygen 1.6.0   Back to index