[pygtk] Resuing tabs?
shuriken at neko.it
Sat Jul 24 16:26:11 WST 2004
On Fri, 23 Jul 2004 10:13:57 +1200, "John C Barstow"
<jbowtie at amathaine.com> wrote:
> I have a project where, having done GLADE layout for a notebook, I
> need multiple instances of a certain tab. They will all be children of
> the same notebook.
I use something like this:
Create a notebook named "nb_main" in glade and add a single tab to it
with all the widgets you need. Call the container within
the tab "tab_contents" In every callback pass "tab_contents" as
The structure shoul be something like
| +- tab_contents
| | +- widget1
| | +- widget2
In prg.glade you should have something like
<widget class="GtkEntry" id="widget1">
<signal name="changed" handler="on_widget1_changed"
object="tab_contents" last_modification_time="Sat, 24 Apr 2004 09:12:57
When you need a new tab:
tablabel = gtk.Label("New tab")
newtab = tablist[maxtab+1].get_widget("tab_contents")
As all the widgets will have the same name and handler of other tabs,
you must use "tab_contents" to know in which tab the signal was born:
for tab in tablist:
we are working on this tab
I simplified a lot and used meta-code, but I hope the concept is clear.
More information about the pygtk