Re: [gtkmm] Gnome:Glade:Xml - More than one window y one .glade file
- From: "Carlos Ble J." <carlosble neuroomante com>
- To: gtkmm-list gnome org
- Subject: Re: [gtkmm] Gnome:Glade:Xml - More than one window y one .glade file
- Date: Wed, 3 Mar 2004 09:31:37 +0100
El Martes, 2 de Marzo de 2004 11:12, Carlos Ble escribió:
> Hi all. Im new in the list. Iam programming with gtkmm and glade using
> libglademm because is a powerful and faster develop platform and i have a
> little question. I have a .glade file with several windows in it but i can
> get only the widgets from the main window. I try to get widgets from other
> windows and the application stop in runtime saying that it cant find the
> widget. At the moment i can open all the windows by typing the name of the
> windows in the second argument of the Xml.create function:
> refGlade_main = Gnome::Glade::Xml::create("main.glade","main");
> refGlade_nuser = Gnome::Glade::Xml::create("main.glade","new_user");
> (Where main and new_user are windows)
> But i can not get widgets from new_user, for example:
> button1 = refGlade_main->get_widget("button19",button1); // this works
> fine cancel = refGlade_nuser->get_widget("button57",cancel); // this doesnt
> work
>
> So the question is ¿should i use a diferent .glade file for every window?
>
No, i can use one .glade file for several windows. The solution is:
refGlade = Gnome::Glade::Xml::create("main.glade");
window = refGlade->get_widget("main",window);
window_nuser = refGlade->get_widget("new_user",window_nuser);
button1 = refGlade->get_widget("button19",button1);
cancel = refGlade->get_widget("button57",cancel);
button19 and button57 are from different windows and it works fine
The problem was the second argument at Xml::create
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]