[pygtk] Cloning Glade notebook tabs?
John Pye
john.pye at student.unsw.edu.au
Tue Jan 31 21:06:07 WST 2006
Solved my problem:
If you want to create a notebook table with a template layout in glade,
create a new *window* in in Glade, and insert your desired template
content into that. Give the top-level container *inside* your window a
memorable name (lets say 'observervbox').
Then, when you want to add a new templated notebook tab (widget object =
'self.maintabs') to your application:
_xml = gtk.glade.XML(GLADE_FILE,"observervbox");
_label = gtk.Label();
_label.set_text(name)
self.maintabs.append_page(_xml.get_widget("observervbox"),_label);
Hopefully this is useful to someone eelse as well.
Cheers
JP
http://pye.dyndns.org/
John Pye wrote:
>Hi all
>
>I have a GUI which has a 'notebook' with two fixed tabs that stay there
>all the time. I want to add extra 'templated' tabs at the end of the
>notebook, at runtime.
>
>If I want to define the template for the 'extra' tabs in Glade, how to I
>go about adding those tabs at runtime, one by one?
>
>Do I need to invoke gtk.glade.XML each time? How do I define the
>template tab in my Glade file?
>
>Cheers
>JP
>
>
>
More information about the pygtk
mailing list