Re: unable to get text from combo box in gtk
- From: Martyn Russell <martyn imendio com>
- To: gomathibabu <gomsfoss au-kbc org>
- Cc: gtk-list gnome org
- Subject: Re: unable to get text from combo box in gtk
- Date: Mon, 14 Nov 2005 13:41:40 +0000
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:
>
> gomathi gomathi:~/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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]