GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

get entry value from dialog and send it to main window

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
wibblecp



Joined: 14 Jul 2007
Posts: 2

PostPosted: Sat Jul 14, 2007 11:09 am    Post subject: get entry value from dialog and send it to main window Reply with quote

Hi everyone,
this is my first post here, you'll understand it early. I am a damned newbie :(
My help request is really simple.

I have to get the entry value in a dialog(MODAL) linked to a menu item.
A button, used to send the value, is also added into the dialog.

Ok let's go. I'd like to use this value to set (or upgrade) a label text present in the main window.

My solutions is not a solution.

Code: (Plaintext)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

static gchar set_name (GtkWidget *, GtkEntry *);

/* We are in the dialog creation function */
....
g_signal_connect (G_OBJECT(button), "clicked",
                         G_CALLBACK(set_name), (gpointer) name_entry);

....

static gchar set_name (GtkWidget * widget,
                                GtkEntry *entry)
{
 const gchar * name = NULL;
 name = gtk_entry_get_text (GTK_ENTRY(entry));

 if(!name)
    g_print("Error!\n");
 else {
   .... ?? ... how i can manage the label in main window?
 }

 return name;
}


/* Main window
label = gtk_label_new();
...



My idea of this seems strange, please give me some advice.
Any advice is great thing.

thanks in advance to everyone for the replies.
Bye
Back to top
wibblecp



Joined: 14 Jul 2007
Posts: 2

PostPosted: Sat Jul 14, 2007 1:41 pm    Post subject: IT'S OK Reply with quote

I apologize for my previuos post. :shock: unredeable!

bye
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP