entry problem



hi list
i have done a simple gtk text entry
i would like to get string from the text entry after a  button pressed
this is the code :

*** function to get string***
void get_the_text (GtkWidget *widget, GtkWidget *entry)
{
  gchar *entry_text;
  entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
  printf("Entry contents: %s\n", entry_text);
 return entry_text;
}


****main****
char *v;
entry1 = gtk_entry_new_with_max_length (50);
button = gtk_button_new_with_label ("gettext");
v= gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
                               GTK_SIGNAL_FUNC(get_the_text ),
                               GTK_OBJECT (entry1));
****i tried also***
v= gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
                               GTK_SIGNAL_FUNC(get_the_text ),
                               entry1);

it segfauls and doens't work
have you suggest??
how can i modify the program?
thanks








-- 


----
*************************************************************
                      Universe Creation 
 ....and God wrote:
                      tar -Uvh BigBeng.tar.gz
#############...unpacking..######################
*************************************************************
Mauro Venanzi linux ru250233
hall2001 athlon-xp rm 135009 on Suse 8.1





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]