Re: duplicating GtkBuilder created widget objects



Hi, AFAIK there's no other way than recall the glade parser many times in
different
main windows functions.
Note that if you call your objects in glade ending with "_1" then you copy
and paste
the first copy will be "_2", the second "_3" and so on, it happened to me
to use this trick
and create a vector in my code of objects ending this way the object names.
Cheers,
Giuseppe.


On Mon, Dec 3, 2012 at 7:12 AM, Joe Steeve <js hipro co in> wrote:

On Sun, 2012-12-02 at 13:35 +0100, Tomasz Jankowski wrote:
I think, that you cannot easily copy widgets. In such situation I
usually use gtk_builder_add_objects_from_file().

When we do this, can there be two sets of objects with the same name? I
dont think so. Scenario: There is one top-level window (win-a). And, a
button in win-a brings up another top-level window (win-b). Each click
on the button should bring a win-b. There can be more than one win-b at
the same time. If I do Builder::add_objects_from_file, wont there be a
name clash of widgets from the new file and the ones already there?

I am now using multiple GtkBuilder objects. I moved win-b into a
separate glade file and load it every time I need a new window. Is there
a better approach?

--
Joe Steeve
HiPro IT Solutions Private Limited
http://hipro.co.in/

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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