Sync Tix from Mike Clarkson, a maintainer
This commit is contained in:
parent
a6483d2e9a
commit
f539bdeb9c
|
@ -285,7 +285,13 @@ class TixWidget(Tkinter.Widget):
|
||||||
# Move static options into extra. static_options must be
|
# Move static options into extra. static_options must be
|
||||||
# a list of keywords (or None).
|
# a list of keywords (or None).
|
||||||
extra=()
|
extra=()
|
||||||
|
|
||||||
|
# 'options' is always a static option
|
||||||
if static_options:
|
if static_options:
|
||||||
|
static_options.append('options')
|
||||||
|
else:
|
||||||
|
static_options = ['options']
|
||||||
|
|
||||||
for k,v in cnf.items()[:]:
|
for k,v in cnf.items()[:]:
|
||||||
if k in static_options:
|
if k in static_options:
|
||||||
extra = extra + ('-' + k, v)
|
extra = extra + ('-' + k, v)
|
||||||
|
@ -1048,10 +1054,11 @@ class ListNoteBook(TixWidget):
|
||||||
|
|
||||||
def __init__(self, master, cnf={}, **kw):
|
def __init__(self, master, cnf={}, **kw):
|
||||||
TixWidget.__init__(self, master, 'tixListNoteBook', ['options'], cnf, kw)
|
TixWidget.__init__(self, master, 'tixListNoteBook', ['options'], cnf, kw)
|
||||||
|
# Is this necessary? It's not an exposed subwidget in Tix.
|
||||||
self.subwidget_list['pane'] = _dummyPanedWindow(self, 'pane',
|
self.subwidget_list['pane'] = _dummyPanedWindow(self, 'pane',
|
||||||
destroy_physically=0)
|
destroy_physically=0)
|
||||||
self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
|
self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
|
||||||
self.subwidget_list['shlist'] = _dummyScrolledHList(self, 'vsb')
|
self.subwidget_list['shlist'] = _dummyScrolledHList(self, 'shlist')
|
||||||
|
|
||||||
def add(self, name, cnf={}, **kw):
|
def add(self, name, cnf={}, **kw):
|
||||||
apply(self.tk.call,
|
apply(self.tk.call,
|
||||||
|
@ -1171,6 +1178,7 @@ class PanedWindow(TixWidget):
|
||||||
def __init__(self, master, cnf={}, **kw):
|
def __init__(self, master, cnf={}, **kw):
|
||||||
TixWidget.__init__(self, master, 'tixPanedWindow', ['orientation', 'options'], cnf, kw)
|
TixWidget.__init__(self, master, 'tixPanedWindow', ['orientation', 'options'], cnf, kw)
|
||||||
|
|
||||||
|
# add delete forget panecget paneconfigure panes setsize
|
||||||
def add(self, name, cnf={}, **kw):
|
def add(self, name, cnf={}, **kw):
|
||||||
apply(self.tk.call,
|
apply(self.tk.call,
|
||||||
(self._w, 'add', name) + self._options(cnf, kw))
|
(self._w, 'add', name) + self._options(cnf, kw))
|
||||||
|
@ -1178,6 +1186,25 @@ class PanedWindow(TixWidget):
|
||||||
check_intermediate=0)
|
check_intermediate=0)
|
||||||
return self.subwidget_list[name]
|
return self.subwidget_list[name]
|
||||||
|
|
||||||
|
def delete(self, name):
|
||||||
|
self.tk.call(self._w, 'delete', name)
|
||||||
|
self.subwidget_list[name].destroy()
|
||||||
|
del self.subwidget_list[name]
|
||||||
|
|
||||||
|
def forget(self, name):
|
||||||
|
self.tk.call(self._w, 'forget', name)
|
||||||
|
|
||||||
|
def panecget(self, entry, opt):
|
||||||
|
return self.tk.call(self._w, 'panecget', entry, opt)
|
||||||
|
|
||||||
|
def paneconfigure(self, entry, cnf={}, **kw):
|
||||||
|
if cnf is None:
|
||||||
|
return _lst2dict(
|
||||||
|
self.tk.split(
|
||||||
|
self.tk.call(self._w, 'paneconfigure', entry)))
|
||||||
|
apply(self.tk.call,
|
||||||
|
(self._w, 'paneconfigure', entry) + self._options(cnf, kw))
|
||||||
|
|
||||||
def panes(self):
|
def panes(self):
|
||||||
names = self.tk.call(self._w, 'panes')
|
names = self.tk.call(self._w, 'panes')
|
||||||
ret = []
|
ret = []
|
||||||
|
@ -1304,6 +1331,38 @@ class Select(TixWidget):
|
||||||
def invoke(self, name):
|
def invoke(self, name):
|
||||||
self.tk.call(self._w, 'invoke', name)
|
self.tk.call(self._w, 'invoke', name)
|
||||||
|
|
||||||
|
class Shell(TixWidget):
|
||||||
|
"""Toplevel window.
|
||||||
|
|
||||||
|
Subwidgets - None"""
|
||||||
|
|
||||||
|
def __init__ (self,master=None,cnf={}, **kw):
|
||||||
|
TixWidget.__init__(self, master, 'tixShell', ['options', 'title'], cnf, kw)
|
||||||
|
|
||||||
|
class DialogShell(TixWidget):
|
||||||
|
"""Toplevel window, with popup popdown and center methods.
|
||||||
|
It tells the window manager that it is a dialog window and should be
|
||||||
|
treated specially. The exact treatment depends on the treatment of
|
||||||
|
the window manager.
|
||||||
|
|
||||||
|
Subwidgets - None"""
|
||||||
|
|
||||||
|
def __init__ (self,master=None,cnf={}, **kw):
|
||||||
|
TixWidget.__init__(self, master,
|
||||||
|
'tixDialogShell',
|
||||||
|
['options', 'title', 'mapped',
|
||||||
|
'minheight', 'minwidth',
|
||||||
|
'parent', 'transient'], cnf, kw)
|
||||||
|
|
||||||
|
def popdown(self):
|
||||||
|
self.tk.call(self._w, 'popdown')
|
||||||
|
|
||||||
|
def popup(self):
|
||||||
|
self.tk.call(self._w, 'popup')
|
||||||
|
|
||||||
|
def center(self):
|
||||||
|
self.tk.call(self._w, 'center')
|
||||||
|
|
||||||
class StdButtonBox(TixWidget):
|
class StdButtonBox(TixWidget):
|
||||||
"""StdButtonBox - Standard Button Box (OK, Apply, Cancel and Help) """
|
"""StdButtonBox - Standard Button Box (OK, Apply, Cancel and Help) """
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue