Results 1 to 3 of 3

Thread: add items to toolbar

  1. #1
    Join Date
    Jul 2005
    Location
    London,England
    Beans
    1,022
    Distro
    Ubuntu Karmic Koala (testing)

    add items to toolbar

    im writing a program, using GTK, mainly as a learning exercise, im trying to create a toolbar and add items to it, but im having problems with the code,

    Code:
    GtkWidget *label;
    	GtkWidget *piccy;
    	GtkWidget *holder;
    	GtkWidget *eventbox;
    	GtkWidget *dropdown;
    	GtkWidget *dropdownbutton;
    
    dropdown = gtk_toolbar_new (); 
    dropdownbutton = gtk_tool_item_new();
    label = gtk_label_new ("Menu");
    gtk_toolbar_insert (dropdown, dropdownbutton, 0);
    gtk_container_add (GTK_CONTAINER (dropdownbutton), label);
    when compiling it, i get a warning
    Code:
    my_applet.c:67: warning: passing argument 1 of ‘gtk_toolbar_insert’ from incompatible pointer type
    my_applet.c:67: warning: passing argument 2 of ‘gtk_toolbar_insert’ from incompatible pointer type
    which refers to the lines above, can anyone tell me what im doing wrong?
    Jeremy Clarkson - "A Dazzling Hero of Political Incorrectness"
    My LastFM profile
    want to Give each GTK program its own theme? well look Here

  2. #2

    Re: add items to toolbar

    you need to cast it using GTK_TOOLBAR(dropdown)

  3. #3
    Join Date
    Jul 2005
    Location
    London,England
    Beans
    1,022
    Distro
    Ubuntu Karmic Koala (testing)

    Re: add items to toolbar

    thanks for the response, worked fine.
    Jeremy Clarkson - "A Dazzling Hero of Political Incorrectness"
    My LastFM profile
    want to Give each GTK program its own theme? well look Here

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •