GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Nov 23, 2014 4:07 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: combo box default option???
PostPosted: Wed Mar 05, 2008 6:17 pm 
Offline
Familiar Face

Joined: Mon Feb 11, 2008 12:28 pm
Posts: 15
hey.

Does anybody know how to set the default text within a combobox?

example:

Code:
widget->combo = gtk_combo_box_new_text ();

gtk_combo_box_append_text (GTK_COMBO_BOX (widget->combo), "option1");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget->combo), "option2");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget->combo), "option3");


is there a function i can use to set the default text of combo box as "option1" so when i compile and run my code, "option1" will be visible in the combo box rather than it just being empty.

Thanks :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 11, 2008 12:36 am 
Offline
Never Seen the Sunlight

Joined: Thu Jun 14, 2007 11:02 pm
Posts: 923
Location: Falun, WI USA
try using this: http://library.gnome.org/devel/gtk/stab ... set-active
a good reference for all widgets and items can be found here:
http://gtk.org/documentation.html
under API


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 11, 2008 1:00 am 
Offline
Familiar Face

Joined: Mon Feb 11, 2008 12:28 pm
Posts: 15
hehehe i had just found that function earlier! thanks a million though. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group