Displaying a very very simple toolbar



I am trying to display a very simple toolbar in my application.
This toolbar is supposed to have few icons on it, when the user clicks an icon, it will call a callback function.
I tried the following code, but nothing was displayed.

GtkToolbar *toolbar;   /* a widget created using GLADE */
GtkWidget *icon;

toolbar = (GtkToolbar *)lookup_widget(window, "toolbar1"); /* lookup the widget created by GLADE */
icon = gtk_image_new_from_stock(GTK_STOCK_NEW, GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_toolbar_append_element(toolbar, GTK_TOOLBAR_CHILD_WIDGET, icon,
           "New", "Add new contact", "Add new contact", icon,
           on_edit1_activate, toolbar);
gtk_toolbar_append_space(toolbar);
gtk_widget_show(icon);

What am I doing wrong?

--
Ori Idan




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