Patch #484994: Improve PanedWindow.
This commit is contained in:
parent
8eb92a014b
commit
01824bf50c
|
@ -1047,17 +1047,29 @@ class ListNoteBook(TixWidget):
|
|||
choosing the name of the desired page in the hlist subwidget."""
|
||||
|
||||
def __init__(self, master, cnf={}, **kw):
|
||||
TixWidget.__init__(self, master, 'tixDirList', ['options'], cnf, kw)
|
||||
TixWidget.__init__(self, master, 'tixListNoteBook', ['options'], cnf, kw)
|
||||
self.subwidget_list['pane'] = _dummyPanedWindow(self, 'pane',
|
||||
destroy_physically=0)
|
||||
self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
|
||||
self.subwidget_list['shlist'] = _dummyScrolledHList(self, 'vsb')
|
||||
|
||||
|
||||
def add(self, name, cnf={}, **kw):
|
||||
apply(self.tk.call,
|
||||
(self._w, 'add', name) + self._options(cnf, kw))
|
||||
self.subwidget_list[name] = TixSubWidget(self, name)
|
||||
return self.subwidget_list[name]
|
||||
|
||||
def page(self, name):
|
||||
return self.subwidget(name)
|
||||
|
||||
def pages(self):
|
||||
# Can't call subwidgets_all directly because we don't want .nbframe
|
||||
names = self.tk.split(self.tk.call(self._w, 'pages'))
|
||||
ret = []
|
||||
for x in names:
|
||||
ret.append(self.subwidget(x))
|
||||
return ret
|
||||
|
||||
def raise_page(self, name): # raise is a python keyword
|
||||
self.tk.call(self._w, 'raise', name)
|
||||
|
||||
|
@ -1594,6 +1606,10 @@ class _dummyNoteBookFrame(NoteBookFrame, TixSubWidget):
|
|||
def __init__(self, master, name, destroy_physically=0):
|
||||
TixSubWidget.__init__(self, master, name, destroy_physically)
|
||||
|
||||
class _dummyPanedWindow(PanedWindow, TixSubWidget):
|
||||
def __init__(self, master, name, destroy_physically=1):
|
||||
TixSubWidget.__init__(self, master, name, destroy_physically)
|
||||
|
||||
########################
|
||||
### Utility Routines ###
|
||||
########################
|
||||
|
|
Loading…
Reference in New Issue