mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
Tix update from Mike Clarkson (maintainer)
This commit is contained in:
parent
8d5dd98a2e
commit
d8b5e3fda1
3 changed files with 68 additions and 21 deletions
|
@ -1,8 +0,0 @@
|
||||||
$Id$
|
|
||||||
|
|
||||||
1) There seems to be a problem with ComboBox that shows up
|
|
||||||
in the ExFileSelectBox demo. The popdown scrolled list widget
|
|
||||||
is being created, then destroyed. This does not happen in Tcl Tix.
|
|
||||||
This is probably a sympton in Tix from _tkinter; if you find the cause
|
|
||||||
of this, please post a patch on http://tix.sourceforge.net.
|
|
||||||
|
|
|
@ -560,6 +560,9 @@ def MkSWindow(w):
|
||||||
top.pack(expand=1, fill=Tix.BOTH)
|
top.pack(expand=1, fill=Tix.BOTH)
|
||||||
bot.pack(fill=Tix.BOTH)
|
bot.pack(fill=Tix.BOTH)
|
||||||
|
|
||||||
|
win.bind('<Map>', func=lambda arg=0, rh=rh, win=win:
|
||||||
|
win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win)))
|
||||||
|
|
||||||
def SWindow_reset(rh, win):
|
def SWindow_reset(rh, win):
|
||||||
win.place(x=30, y=150, width=190, height=120)
|
win.place(x=30, y=150, width=190, height=120)
|
||||||
win.update()
|
win.update()
|
||||||
|
@ -575,8 +578,18 @@ def MkSText(w):
|
||||||
text='The Tix ScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.')
|
text='The Tix ScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.')
|
||||||
|
|
||||||
win = Tix.ScrolledText(top, scrollbar='auto')
|
win = Tix.ScrolledText(top, scrollbar='auto')
|
||||||
# win.text['wrap'] = 'none'
|
win.text['wrap'] = 'none'
|
||||||
win.text.insert(Tix.END, 'This is a text widget embedded in a scrolled window. Although the original Tix demo does not have any text here, I decided to put in some so that you can see the effect of scrollbars etc.')
|
win.text.insert(Tix.END, '''When -scrollbar is set to "auto", the
|
||||||
|
scrollbars are shown only when needed.
|
||||||
|
Additional modifiers can be used to force a
|
||||||
|
scrollbar to be shown or hidden. For example,
|
||||||
|
"auto -y" means the horizontal scrollbar
|
||||||
|
should be shown when needed but the vertical
|
||||||
|
scrollbar should always be hidden;
|
||||||
|
"auto +x" means the vertical scrollbar
|
||||||
|
should be shown when needed but the horizontal
|
||||||
|
scrollbar should always be shown, and so on.'''
|
||||||
|
)
|
||||||
win.place(x=30, y=150, width=190, height=100)
|
win.place(x=30, y=150, width=190, height=100)
|
||||||
|
|
||||||
rh = Tix.ResizeHandle(top, bg='black',
|
rh = Tix.ResizeHandle(top, bg='black',
|
||||||
|
|
|
@ -203,12 +203,16 @@ class Tk(Tkinter.Tk, tixCommand):
|
||||||
self.tk.eval('global auto_path; lappend auto_path {%s}' % tixlib)
|
self.tk.eval('global auto_path; lappend auto_path {%s}' % tixlib)
|
||||||
self.tk.eval('global tcl_pkgPath; lappend tcl_pkgPath {%s}' % tixlib)
|
self.tk.eval('global tcl_pkgPath; lappend tcl_pkgPath {%s}' % tixlib)
|
||||||
# Load Tix - this should work dynamically or statically
|
# Load Tix - this should work dynamically or statically
|
||||||
# If it's static, lib/tix8.1/pkgIndex.tcl should have
|
# If it's static, tcl/tix8.1/pkgIndex.tcl should have
|
||||||
# 'load {} Tix'
|
# 'load {} Tix'
|
||||||
# If it's dynamic under Unix, lib/tix8.1/pkgIndex.tcl should have
|
# If it's dynamic under Unix, tcl/tix8.1/pkgIndex.tcl should have
|
||||||
# 'load libtix8.1.8.3.so Tix'
|
# 'load libtix8.1.8.3.so Tix'
|
||||||
self.tk.eval('package require Tix')
|
self.tk.eval('package require Tix')
|
||||||
|
|
||||||
|
def destroy(self):
|
||||||
|
# For safety, remove an delete_window binding before destroy
|
||||||
|
self.protocol("WM_DELETE_WINDOW", "")
|
||||||
|
Tkinter.Tk.destroy(self)
|
||||||
|
|
||||||
# The Tix 'tixForm' geometry manager
|
# The Tix 'tixForm' geometry manager
|
||||||
class Form:
|
class Form:
|
||||||
|
@ -1669,16 +1673,20 @@ class _dummyTList(TList, TixSubWidget):
|
||||||
|
|
||||||
class _dummyComboBox(ComboBox, TixSubWidget):
|
class _dummyComboBox(ComboBox, TixSubWidget):
|
||||||
def __init__(self, master, name, destroy_physically=1):
|
def __init__(self, master, name, destroy_physically=1):
|
||||||
TixSubWidget.__init__(self, master, name, destroy_physically)
|
TixSubWidget.__init__(self, master, name, ['fancy',destroy_physically])
|
||||||
|
self.subwidget_list['label'] = _dummyLabel(self, 'label')
|
||||||
self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
|
self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
|
||||||
self.subwidget_list['arrow'] = _dummyButton(self, 'arrow')
|
self.subwidget_list['arrow'] = _dummyButton(self, 'arrow')
|
||||||
# I'm not sure about this destroy_physically=0 in all cases;
|
|
||||||
# it may depend on if -dropdown is true; I've added as a trial
|
|
||||||
self.subwidget_list['slistbox'] = _dummyScrolledListBox(self,
|
self.subwidget_list['slistbox'] = _dummyScrolledListBox(self,
|
||||||
'slistbox',
|
'slistbox')
|
||||||
destroy_physically=0)
|
try:
|
||||||
self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox',
|
self.subwidget_list['tick'] = _dummyButton(self, 'tick')
|
||||||
destroy_physically=0)
|
#cross Button : present if created with the fancy option
|
||||||
|
self.subwidget_list['cross'] = _dummyButton(self, 'cross')
|
||||||
|
except TypeError:
|
||||||
|
# unavailable when -fancy not specified
|
||||||
|
pass
|
||||||
|
|
||||||
class _dummyDirList(DirList, TixSubWidget):
|
class _dummyDirList(DirList, TixSubWidget):
|
||||||
def __init__(self, master, name, destroy_physically=1):
|
def __init__(self, master, name, destroy_physically=1):
|
||||||
|
@ -1738,9 +1746,11 @@ class _dummyPanedWindow(PanedWindow, TixSubWidget):
|
||||||
### Utility Routines ###
|
### Utility Routines ###
|
||||||
########################
|
########################
|
||||||
|
|
||||||
# Returns the qualified path name for the widget. Normally used to set
|
#mike Should tixDestroy be exposed as a wrapper? - but not for widgets.
|
||||||
# default options for subwidgets. See tixwidgets.py
|
|
||||||
def OptionName(widget):
|
def OptionName(widget):
|
||||||
|
'''Returns the qualified path name for the widget. Normally used to set
|
||||||
|
default options for subwidgets. See tixwidgets.py'''
|
||||||
return widget.tk.call('tixOptionName', widget._w)
|
return widget.tk.call('tixOptionName', widget._w)
|
||||||
|
|
||||||
# Called with a dictionary argument of the form
|
# Called with a dictionary argument of the form
|
||||||
|
@ -1766,6 +1776,38 @@ class CObjView(TixWidget):
|
||||||
# FIXME: It should inherit -superclass tixScrolledWidget
|
# FIXME: It should inherit -superclass tixScrolledWidget
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class Grid(TixWidget):
|
||||||
|
'''The Tix Grid command creates a new window and makes it into a
|
||||||
|
tixGrid widget. Additional options, may be specified on the command
|
||||||
|
line or in the option database to configure aspects such as its cursor
|
||||||
|
and relief.
|
||||||
|
|
||||||
|
A Grid widget displays its contents in a two dimensional grid of cells.
|
||||||
|
Each cell may contain one Tix display item, which may be in text,
|
||||||
|
graphics or other formats. See the DisplayStyle class for more information
|
||||||
|
about Tix display items. Individual cells, or groups of cells, can be
|
||||||
|
formatted with a wide range of attributes, such as its color, relief and
|
||||||
|
border.
|
||||||
|
|
||||||
|
Subwidgets - None'''
|
||||||
|
pass
|
||||||
|
|
||||||
|
# def anchor option ?args ...?
|
||||||
|
# def bdtype
|
||||||
|
# def delete dim from ?to?
|
||||||
|
# def edit apply
|
||||||
|
# def edit set x y
|
||||||
|
# def entrycget x y option
|
||||||
|
# def entryconfigure x y ?option? ?value option value ...?
|
||||||
|
# def format
|
||||||
|
# def index
|
||||||
|
# def move dim from to offset
|
||||||
|
# def set x y ?-itemtype type? ?option value...?
|
||||||
|
# def size dim index ?option value ...?
|
||||||
|
# def unset x y
|
||||||
|
# def xview
|
||||||
|
# def yview
|
||||||
|
|
||||||
class ScrolledGrid(TixWidget):
|
class ScrolledGrid(TixWidget):
|
||||||
'''Scrolled Grid widgets'''
|
'''Scrolled Grid widgets'''
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue