On Mon, 2005-11-14 at 11:39 +0530, gomathibabu wrote:
> hai,
> when i try to get selected text from combo box in gtk,it gives the error
> message.i pasted my coding and also error message this mail.please reply
> me as soon as possible.
>
> Actually i wrote these statements in "clicked" event of the ok button.i
> declared combo box as global variable.
>
> GtkWidget *Algorithm_combo;
>
> void on_ok_button_clicked( )
> {
> gchar *algorithm;
> algorithm=gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(Algorithm_combo)->entry));
> printf("%s",algorithm);
> }
>
>
> Error:
>
> [EMAIL PROTECTED]:~/primitive$ gcc primitive.c -o primitive `pkg-config
> --cflags --libs gtk+-2.0`
> primitive.c: In function `on_ok_button_clicked':
> primitive.c:73: warning: assignment discards qualifiers from pointer
> target type
If you look at the documentation you should find that
gtk_entry_get_text() returns a const gchar *.
Change your:
gchar *algorithm;
to:
const gchar *algorithm;
--
Regards,
Martyn
_______________________________________________
gtk-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-list