Re: entry problem
- From: Mauro Venanzi <jjfnet libero it>
- To: "amitjain" <amitjain webdunia com>, listagtk <gtk-list gnome org>
- Subject: Re: entry problem
- Date: Mon, 2 Dec 2002 17:10:48 +0100
Alle 08:25, luned́ 2 dicembre 2002, hai scritto:
it segfauls
is possible that there is no way to turn back a simple vector in the main
program after one a button click???i dont' beleave
thank'you
> You should Use.
> *** function to get string***
> static gchar *entry_text;(global to file)
> void get_the_text (GtkWidget *widget, GtkWidget *entry)
> {
> entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
> printf("Entry contents: %s\n", 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));
>
> Bye
> Amit Jain
>
> ----- Original Message -----
> From: "Mauro Venanzi" <jjfnet libero it>
> To: <gtk-list gnome org>
> Sent: Sunday, December 01, 2002 8:27 PM
> Subject: 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]