PDA

View Full Version : Gtk combo



bradleyd
March 20th, 2007, 07:10 PM
Hello everyone,
I am stuck on a Gtk combo. I have this code below on a button signal connect.

val = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(data->combo)->entry));
if ( val == "Support Alpha" ){
printf("hi1"\n);
}
else if (val == "Support Bravo"){
printf("hi2"\n);
}
else if ("val == "Support Charlie"){
printf("hi3"\n);
}
There are three entries in the combo box. When the user selects one and the presses button I need to distinguish between which one the user selected.
any help would be appreciated.
Thanks,
brad

-Rick-
March 22nd, 2007, 05:21 PM
See this (http://c-faq.com/charstring/stringeq.html) link on howto compare strings in C.

bradleyd
March 22nd, 2007, 05:52 PM
thanks, that worked perfectly.