get entry value from child and send it to the parent



Hi everyone,
  this is my first post here, you'll understand it early.

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();
...
[/code]


thanks in advance to everyone for the replies.
Bye




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