GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Aug 23, 2014 6:02 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: get entry value from dialog and send it to main window
PostPosted: Sat Jul 14, 2007 11:09 am 
Offline

Joined: Sat Jul 14, 2007 10:43 am
Posts: 2
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:
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


Top
 Profile  
 
 Post subject: IT'S OK
PostPosted: Sat Jul 14, 2007 1:41 pm 
Offline

Joined: Sat Jul 14, 2007 10:43 am
Posts: 2
I apologize for my previuos post. :shock: unredeable!

bye


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group