Logo Search packages:      
Sourcecode: inkscape version File versions

static GtkWidget* sp_ui_menu_append_item ( GtkMenu *  menu,
gchar const *  stock,
gchar const *  label,
gchar const *  tip,
Inkscape::UI::View::View view,
GCallback  callback,
gpointer  data,
gboolean  with_mnemonic = TRUE 
) [static]

sp_ui_menu_append_item

Appends a UI item with specific info for Inkscape/Sodipodi.

Definition at line 419 of file interface.cpp.

{
    GtkWidget *item;

    if (stock) {
        item = gtk_image_menu_item_new_from_stock(stock, NULL);
    } else if (label) {
        item = (with_mnemonic)
            ? gtk_image_menu_item_new_with_mnemonic(label) :
            gtk_image_menu_item_new_with_label(label);
    } else {
        item = gtk_separator_menu_item_new();
    }

    gtk_widget_show(item);

    if (callback) {
        g_signal_connect(G_OBJECT(item), "activate", callback, data);
    }

    if (tip && view) {
        g_object_set_data(G_OBJECT(item), "view", (gpointer) view);
        g_signal_connect( G_OBJECT(item), "select", G_CALLBACK(sp_ui_menu_select), (gpointer) tip );
        g_signal_connect( G_OBJECT(item), "deselect", G_CALLBACK(sp_ui_menu_deselect), NULL);
    }

    gtk_menu_append(GTK_MENU(menu), item);

    return item;

} // end of sp_ui_menu_append_item()


Generated by  Doxygen 1.6.0   Back to index