help for a newbie
- From: christophe Meyer <chr meyer nerim net>
- To: gtk-app-devel-list gnome org
- Subject: help for a newbie
- Date: Sun, 11 Jan 2004 16:32:12 +0100
hi all,
I'm writing an application which contains 2 windows:
-a first main window wich contains some labels and a button for opening
the second window.
-a second window (a dialog box) where you can enter a string in an entry,
and then when you clic on the ok button, the string you've entered
appears in a first-window label.
The label where the string should appear in the first window is "label39",
and the entry box in the dialog window is "entry2".
And this is the callback function of the dialog's box ok button:
void
on_config_station_valider_clicked (GtkButton *button,
gpointer user_data)
{
GtkWidget * fenetre_config_station =
gtk_widget_get_toplevel(GTK_WIDGET(button));
GtkWidget * station = lookup_widget(GTK_WIDGET(button), "entry2");
GtkWidget * label = lookup_widget(GTK_WIDGET(button), "label39");
gtk_label_set_text(GTK_LABEL(label), gtk_entry_get_text(GTK_ENTRY(station)));
gtk_widget_hide(fenetre_config_station);
}
And this is a part of my main.c :
config_station = create_config_station();
gtk_object_set_data (GTK_OBJECT (window1), "fenetre_config_station",
config_station);
The problem is that when i click the button, nothing appears in the
"label39" label, and i have this message:
WARNING **: Widget not found: label39
I think that's because label39 isn't in the same window as the button :(
How can i solve this problem ?
Thanks for your help :)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]