Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 01824bf

Browse files
committed
Patch #484994: Improve PanedWindow.
1 parent 8eb92a0 commit 01824bf

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

Lib/lib-tk/Tix.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,17 +1047,29 @@ class ListNoteBook(TixWidget):
10471047
choosing the name of the desired page in the hlist subwidget."""
10481048

10491049
def __init__(self, master, cnf={}, **kw):
1050-
TixWidget.__init__(self, master, 'tixDirList', ['options'], cnf, kw)
1051-
self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
1052-
self.subwidget_list['shlist'] = _dummyScrolledHList(self, 'vsb')
1053-
1050+
TixWidget.__init__(self, master, 'tixListNoteBook', ['options'], cnf, kw)
1051+
self.subwidget_list['pane'] = _dummyPanedWindow(self, 'pane',
1052+
destroy_physically=0)
1053+
self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
1054+
self.subwidget_list['shlist'] = _dummyScrolledHList(self, 'vsb')
10541055

10551056
def add(self, name, cnf={}, **kw):
10561057
apply(self.tk.call,
10571058
(self._w, 'add', name) + self._options(cnf, kw))
10581059
self.subwidget_list[name] = TixSubWidget(self, name)
10591060
return self.subwidget_list[name]
10601061

1062+
def page(self, name):
1063+
return self.subwidget(name)
1064+
1065+
def pages(self):
1066+
# Can't call subwidgets_all directly because we don't want .nbframe
1067+
names = self.tk.split(self.tk.call(self._w, 'pages'))
1068+
ret = []
1069+
for x in names:
1070+
ret.append(self.subwidget(x))
1071+
return ret
1072+
10611073
def raise_page(self, name): # raise is a python keyword
10621074
self.tk.call(self._w, 'raise', name)
10631075

@@ -1594,6 +1606,10 @@ class _dummyNoteBookFrame(NoteBookFrame, TixSubWidget):
15941606
def __init__(self, master, name, destroy_physically=0):
15951607
TixSubWidget.__init__(self, master, name, destroy_physically)
15961608

1609+
class _dummyPanedWindow(PanedWindow, TixSubWidget):
1610+
def __init__(self, master, name, destroy_physically=1):
1611+
TixSubWidget.__init__(self, master, name, destroy_physically)
1612+
15971613
########################
15981614
### Utility Routines ###
15991615
########################

0 commit comments

Comments
 (0)