Re: Code compiles...but doesn't work (user input w/ gtk_entry )
- From: "Vadim Berezniker" <vadim berezniker com>
- To: "george carter" <cglobal25 hotmail com>
- Cc: gtk-list gnome org
- Subject: Re: Code compiles...but doesn't work (user input w/ gtk_entry )
- Date: Sun, 10 Aug 2003 19:39:30 -0400 (EDT)
>
> void ClearEntry ( GtkButton * CancelButton, gpointer data )
> {
> GtkWidget * textentry ;
> gtk_entry_set_text ( GTK_ENTRY ( textentry ), "" ) ;
> }
You're trying to set text on something that's not even initialized.
Calling a variable 'textentry' won't magically point it to the text entry
in the program.
> gtk_signal_connect ( GTK_OBJECT ( CancelButton ),
> "pressed",
> GTK_SIGNAL_FUNC ( ClearEntry ),
> "pressed" ) ;
The last parameter is used to passing data. You should change it to the
variable containing the reference to the Entry box then inside the
ClearEntry callback you can do
gtk_entry_set_text(data, "");
As for comparing strings, you can use the strcmp function.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]