GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

combo box default option???

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
angel face
Familiar Face


Joined: 11 Feb 2008
Posts: 15

PostPosted: Wed Mar 05, 2008 6:17 pm    Post subject: combo box default option??? Reply with quote

hey.

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

example:

Code: (Plaintext)
1
2
3
4
5
6
7

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 :)
Back to top
dreblen
Familiar Face


Joined: 14 Jun 2007
Posts: 47

PostPosted: Tue Mar 11, 2008 12:36 am    Post subject: Reply with quote

try using this: http://library.gnome.org/devel/gtk/stable/GtkComboBox.html#gtk-combo-box-set-active
a good reference for all widgets and items can be found here:
http://gtk.org/documentation.html
under API
Back to top
angel face
Familiar Face


Joined: 11 Feb 2008
Posts: 15

PostPosted: Tue Mar 11, 2008 1:00 am    Post subject: Reply with quote

hehehe i had just found that function earlier! thanks a million though. :)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP