Re: Code compiles...but doesn't work (user input w/ gtk_entry )



>
> 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]