GTK+ help needed: How do I add a GtkEntry so that it fills a GtkToolbar?

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2009
Posts: 9
Reputation: silviubogan is an unknown quantity at this point 
Solved Threads: 1
silviubogan's Avatar
silviubogan silviubogan is offline Offline
Newbie Poster

GTK+ help needed: How do I add a GtkEntry so that it fills a GtkToolbar?

 
0
  #1
Aug 16th, 2009
This is a just simplified case because my C file is too big to post it here:

  1. int main(int argc, char **argv) {
  2. GtkWidget *window, *vbox, *toolbar, *locationentry;
  3. GtkToolItem *locationbar;
  4.  
  5. gtk_init(&argc, &argv);
  6.  
  7. window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  8. vbox = gtk_vbox_new(FALSE, 0);
  9. toolbar = gtk_toolbar_new();
  10. locationentry = gtk_entry_new();
  11. locationbar = gtk_tool_item_new();
  12.  
  13. gtk_container_add(GTK_CONTAINER(locationbar), locationentry);
  14. gtk_toolbar_insert(GTK_TOOLBAR(toolbar), locationbar, -1);
  15. gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
  16. gtk_container_add(GTK_CONTAINER(window), vbox);
  17.  
  18. gtk_widget_show_all(window);
  19.  
  20. gtk_main();
  21.  
  22. return 0;
  23. }

How do I add locationentry to the toolbar so that it fills the toolbar? GtkToolItem does not subclass GtkBox so I can't use gtk_box_pack_start function which has the fill argument I need here.

I attached the big C file.

I forgot to say that I'm using Webkit GTK+ port (libwebkit-dev package on Ubuntu 9.10). The simplified case does not use this lib, but the main.c file I attached uses it.

PS: Sorry for my bad English..
Last edited by silviubogan; Aug 16th, 2009 at 11:11 am. Reason: To specify the WebkitGTK+ lib I use.
Attached Files
File Type: c main.c (4.5 KB, 1 views)
--Silviu Bogan
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC