[Python-checkins] python/dist/src/Lib/lib-tk Tix.py,1.11,1.12

nnorwitz@users.sourceforge.net nnorwitz@users.sourceforge.net
Wed, 13 Nov 2002 18:43:43 -0800


Update of /cvsroot/python/python/dist/src/Lib/lib-tk
In directory usw-pr-cvs1:/tmp/cvs-serv11273

Modified Files:
	Tix.py 
Log Message:
Sync Tix from Mike Clarkson, a maintainer


Index: Tix.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tix.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Tix.py	19 Sep 2002 08:12:55 -0000	1.11
--- Tix.py	14 Nov 2002 02:43:40 -0000	1.12
***************
*** 286,294 ****
          # a list of keywords (or None).
          extra=()
          if static_options:
!             for k,v in cnf.items()[:]:
!                 if k in static_options:
!                     extra = extra + ('-' + k, v)
!                     del cnf[k]
  
          self.widgetName = widgetName
--- 286,300 ----
          # a list of keywords (or None).
          extra=()
+ 
+         # 'options' is always a static option
          if static_options:
!             static_options.append('options')
!         else:
!             static_options = ['options']
!             
!         for k,v in cnf.items()[:]:
!             if k in static_options:
!                 extra = extra + ('-' + k, v)
!                 del cnf[k]
  
          self.widgetName = widgetName
***************
*** 409,414 ****
                      # Create the intermediate widget
                      parent = TixSubWidget(parent, plist[i],
!                                        destroy_physically=0,
!                                        check_intermediate=0)
              TixWidget.__init__(self, parent, None, None, {'name' : name})
          self.destroy_physically = destroy_physically
--- 415,420 ----
                      # Create the intermediate widget
                      parent = TixSubWidget(parent, plist[i],
!                                           destroy_physically=0,
!                                           check_intermediate=0)
              TixWidget.__init__(self, parent, None, None, {'name' : name})
          self.destroy_physically = destroy_physically
***************
*** 473,478 ****
          return _lst2dict(
              self.tk.split(
!                apply(self.tk.call,
!                      (self.stylename, 'configure') + self._options(cnf,kw))))
  
      def __getitem__(self,key):
--- 479,484 ----
          return _lst2dict(
              self.tk.split(
!             apply(self.tk.call,
!                   (self.stylename, 'configure') + self._options(cnf,kw))))
  
      def __getitem__(self,key):
***************
*** 632,638 ****
      Subwidget       Class
      ---------       -----
!     hlist       HList
!     hsb              Scrollbar
!     vsb              Scrollbar"""
  
      def __init__(self, master, cnf={}, **kw):
--- 638,644 ----
      Subwidget       Class
      ---------       -----
!     hlist           HList
!     hsb             Scrollbar
!     vsb             Scrollbar"""
  
      def __init__(self, master, cnf={}, **kw):
***************
*** 655,661 ****
      ---------       -----
      selection       ComboBox
!     filter       ComboBox
!     dirlist       ScrolledListBox
!     filelist       ScrolledListBox"""
  
      def __init__(self, master, cnf={}, **kw):
--- 661,667 ----
      ---------       -----
      selection       ComboBox
!     filter          ComboBox
!     dirlist         ScrolledListBox
!     filelist        ScrolledListBox"""
  
      def __init__(self, master, cnf={}, **kw):
***************
*** 709,713 ****
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixDirSelectDialog',
!                          ['options'], cnf, kw)
          self.subwidget_list['dirbox'] = _dummyDirSelectBox(self, 'dirbox')
          # cancel and ok buttons are missing
--- 715,719 ----
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixDirSelectDialog',
!                            ['options'], cnf, kw)
          self.subwidget_list['dirbox'] = _dummyDirSelectBox(self, 'dirbox')
          # cancel and ok buttons are missing
***************
*** 731,735 ****
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixExFileSelectDialog',
!                          ['options'], cnf, kw)
          self.subwidget_list['fsbox'] = _dummyExFileSelectBox(self, 'fsbox')
  
--- 737,741 ----
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixExFileSelectDialog',
!                            ['options'], cnf, kw)
          self.subwidget_list['fsbox'] = _dummyExFileSelectBox(self, 'fsbox')
  
***************
*** 750,756 ****
      ---------       -----
      selection       ComboBox
!     filter       ComboBox
!     dirlist       ScrolledListBox
!     filelist       ScrolledListBox"""
  
      def __init__(self, master, cnf={}, **kw):
--- 756,762 ----
      ---------       -----
      selection       ComboBox
!     filter          ComboBox
!     dirlist         ScrolledListBox
!     filelist        ScrolledListBox"""
  
      def __init__(self, master, cnf={}, **kw):
***************
*** 778,782 ****
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixFileSelectDialog',
!                          ['options'], cnf, kw)
          self.subwidget_list['btns'] = _dummyStdButtonBox(self, 'btns')
          self.subwidget_list['fsbox'] = _dummyFileSelectBox(self, 'fsbox')
--- 784,788 ----
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixFileSelectDialog',
!                            ['options'], cnf, kw)
          self.subwidget_list['btns'] = _dummyStdButtonBox(self, 'btns')
          self.subwidget_list['fsbox'] = _dummyFileSelectBox(self, 'fsbox')
***************
*** 801,805 ****
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixFileEntry',
!                          ['dialogtype', 'options'], cnf, kw)
          self.subwidget_list['button'] = _dummyButton(self, 'button')
          self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
--- 807,811 ----
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixFileEntry',
!                            ['dialogtype', 'options'], cnf, kw)
          self.subwidget_list['button'] = _dummyButton(self, 'button')
          self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
***************
*** 822,830 ****
      def __init__ (self,master=None,cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixHList',
!                          ['columns', 'options'], cnf, kw)
  
      def add(self, entry, cnf={}, **kw):
          return apply(self.tk.call,
!                     (self._w, 'add', entry) + self._options(cnf, kw))
  
      def add_child(self, parent=None, cnf={}, **kw):
--- 828,836 ----
      def __init__ (self,master=None,cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixHList',
!                            ['columns', 'options'], cnf, kw)
  
      def add(self, entry, cnf={}, **kw):
          return apply(self.tk.call,
!                      (self._w, 'add', entry) + self._options(cnf, kw))
  
      def add_child(self, parent=None, cnf={}, **kw):
***************
*** 832,836 ****
              parent = ''
          return apply(self.tk.call,
!                     (self._w, 'addchild', parent) + self._options(cnf, kw))
  
      def anchor_set(self, entry):
--- 838,842 ----
              parent = ''
          return apply(self.tk.call,
!                      (self._w, 'addchild', parent) + self._options(cnf, kw))
  
      def anchor_set(self, entry):
***************
*** 845,849 ****
          else:
              return self.tk.call(self._w, 'column', 'width', col,
!                              '-char', chars)
  
      def delete_all(self):
--- 851,855 ----
          else:
              return self.tk.call(self._w, 'column', 'width', col,
!                                 '-char', chars)
  
      def delete_all(self):
***************
*** 878,883 ****
          if cnf is None:
              return _lst2dict(
!                self.tk.split(
!                    self.tk.call(self._w, 'header', 'configure', col)))
          apply(self.tk.call, (self._w, 'header', 'configure', col)
                + self._options(cnf, kw))
--- 884,889 ----
          if cnf is None:
              return _lst2dict(
!                 self.tk.split(
!                 self.tk.call(self._w, 'header', 'configure', col)))
          apply(self.tk.call, (self._w, 'header', 'configure', col)
                + self._options(cnf, kw))
***************
*** 905,910 ****
          if cnf is None:
              return _lst2dict(
!                self.tk.split(
!                    self.tk.call(self._w, 'indicator', 'configure', entry)))
          apply(self.tk.call,
                (self._w, 'indicator', 'configure', entry) + self._options(cnf, kw))
--- 911,916 ----
          if cnf is None:
              return _lst2dict(
!                 self.tk.split(
!                 self.tk.call(self._w, 'indicator', 'configure', entry)))
          apply(self.tk.call,
                (self._w, 'indicator', 'configure', entry) + self._options(cnf, kw))
***************
*** 957,962 ****
          if cnf is None:
              return _lst2dict(
!                self.tk.split(
!                    self.tk.call(self._w, 'item', 'configure', entry, col)))
          apply(self.tk.call, (self._w, 'item', 'configure', entry, col) +
                self._options(cnf, kw))
--- 963,968 ----
          if cnf is None:
              return _lst2dict(
!                 self.tk.split(
!                 self.tk.call(self._w, 'item', 'configure', entry, col)))
          apply(self.tk.call, (self._w, 'item', 'configure', entry, col) +
                self._options(cnf, kw))
***************
*** 1017,1021 ****
      def __init__ (self,master=None,cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixLabelEntry',
!                          ['labelside','options'], cnf, kw)
          self.subwidget_list['label'] = _dummyLabel(self, 'label')
          self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
--- 1023,1027 ----
      def __init__ (self,master=None,cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixLabelEntry',
!                            ['labelside','options'], cnf, kw)
          self.subwidget_list['label'] = _dummyLabel(self, 'label')
          self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
***************
*** 1034,1038 ****
      def __init__ (self,master=None,cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixLabelFrame',
!                          ['labelside','options'], cnf, kw)
          self.subwidget_list['label'] = _dummyLabel(self, 'label')
          self.subwidget_list['frame'] = _dummyFrame(self, 'frame')
--- 1040,1044 ----
      def __init__ (self,master=None,cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixLabelFrame',
!                            ['labelside','options'], cnf, kw)
          self.subwidget_list['label'] = _dummyLabel(self, 'label')
          self.subwidget_list['frame'] = _dummyFrame(self, 'frame')
***************
*** 1048,1056 ****
  
      def __init__(self, master, 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):
--- 1054,1063 ----
  
      def __init__(self, master, 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',
!                                                         destroy_physically=0)
!         self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
!         self.subwidget_list['shlist'] = _dummyScrolledHList(self, 'shlist')
  
      def add(self, name, cnf={}, **kw):
***************
*** 1081,1085 ****
      def __init__(self, master=None, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixMeter',
!                          ['options'], cnf, kw)
  
  class NoteBook(TixWidget):
--- 1088,1092 ----
      def __init__(self, master=None, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixMeter',
!                            ['options'], cnf, kw)
  
  class NoteBook(TixWidget):
***************
*** 1094,1098 ****
          TixWidget.__init__(self,master,'tixNoteBook', ['options'], cnf, kw)
          self.subwidget_list['nbframe'] = TixSubWidget(self, 'nbframe',
!                                                  destroy_physically=0)
  
      def add(self, name, cnf={}, **kw):
--- 1101,1105 ----
          TixWidget.__init__(self,master,'tixNoteBook', ['options'], cnf, kw)
          self.subwidget_list['nbframe'] = TixSubWidget(self, 'nbframe',
!                                                       destroy_physically=0)
  
      def add(self, name, cnf={}, **kw):
***************
*** 1133,1138 ****
      Subwidget       Class
      ---------       -----
!     menubutton       Menubutton
!     menu       Menu"""
  
      def __init__(self, master, cnf={}, **kw):
--- 1140,1145 ----
      Subwidget       Class
      ---------       -----
!     menubutton      Menubutton
!     menu            Menu"""
  
      def __init__(self, master, cnf={}, **kw):
***************
*** 1172,1182 ****
          TixWidget.__init__(self, master, 'tixPanedWindow', ['orientation', 'options'], cnf, kw)
  
      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,
!                                             check_intermediate=0)
          return self.subwidget_list[name]
  
      def panes(self):
          names = self.tk.call(self._w, 'panes')
--- 1179,1209 ----
          TixWidget.__init__(self, master, 'tixPanedWindow', ['orientation', 'options'], cnf, kw)
  
+     # add delete forget panecget paneconfigure panes setsize
      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,
!                                                  check_intermediate=0)
          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):
          names = self.tk.call(self._w, 'panes')
***************
*** 1222,1226 ****
          # In fact, x y height width are configurable
          TixWidget.__init__(self, master, 'tixResizeHandle',
!                             flags, cnf, kw)
  
      def attach_widget(self, widget):
--- 1249,1253 ----
          # In fact, x y height width are configurable
          TixWidget.__init__(self, master, 'tixResizeHandle',
!                            flags, cnf, kw)
  
      def attach_widget(self, widget):
***************
*** 1241,1245 ****
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixScrolledHList', ['options'],
!                          cnf, kw)
          self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
          self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
--- 1268,1272 ----
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixScrolledHList', ['options'],
!                            cnf, kw)
          self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
          self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
***************
*** 1269,1273 ****
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixScrolledTList', ['options'],
!                          cnf, kw)
          self.subwidget_list['tlist'] = _dummyTList(self, 'tlist')
          self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
--- 1296,1300 ----
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixScrolledTList', ['options'],
!                            cnf, kw)
          self.subwidget_list['tlist'] = _dummyTList(self, 'tlist')
          self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
***************
*** 1291,1297 ****
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixSelect',
!                          ['allowzero', 'radio', 'orientation', 'labelside',
!                           'options'],
!                          cnf, kw)
          self.subwidget_list['label'] = _dummyLabel(self, 'label')
  
--- 1318,1324 ----
      def __init__(self, master, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixSelect',
!                            ['allowzero', 'radio', 'orientation', 'labelside',
!                             'options'],
!                            cnf, kw)
          self.subwidget_list['label'] = _dummyLabel(self, 'label')
  
***************
*** 1305,1308 ****
--- 1332,1367 ----
          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):
      """StdButtonBox - Standard Button Box (OK, Apply, Cancel and Help) """
***************
*** 1310,1314 ****
      def __init__(self, master=None, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixStdButtonBox',
!                          ['orientation', 'options'], cnf, kw)
          self.subwidget_list['ok'] = _dummyButton(self, 'ok')
          self.subwidget_list['apply'] = _dummyButton(self, 'apply')
--- 1369,1373 ----
      def __init__(self, master=None, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixStdButtonBox',
!                            ['orientation', 'options'], cnf, kw)
          self.subwidget_list['ok'] = _dummyButton(self, 'ok')
          self.subwidget_list['apply'] = _dummyButton(self, 'apply')
***************
*** 1362,1366 ****
      def insert(self, index, cnf={}, **kw):
          apply(self.tk.call,
!                (self._w, 'insert', index) + self._options(cnf, kw))
  
      def info_active(self):
--- 1421,1425 ----
      def insert(self, index, cnf={}, **kw):
          apply(self.tk.call,
!               (self._w, 'insert', index) + self._options(cnf, kw))
  
      def info_active(self):
***************
*** 1418,1422 ****
      def __init__(self, master=None, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixTree',
!                          ['options'], cnf, kw)
          self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
          self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
--- 1477,1481 ----
      def __init__(self, master=None, cnf={}, **kw):
          TixWidget.__init__(self, master, 'tixTree',
!                            ['options'], cnf, kw)
          self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
          self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
***************
*** 1552,1559 ****
          # it may depend on if -dropdown is true; I've added as a trial
          self.subwidget_list['slistbox'] = _dummyScrolledListBox(self,
!                                                          'slistbox',
!                                                          destroy_physically=0)
          self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox',
!                                                   destroy_physically=0)
  
  class _dummyDirList(DirList, TixSubWidget):
--- 1611,1618 ----
          # it may depend on if -dropdown is true; I've added as a trial
          self.subwidget_list['slistbox'] = _dummyScrolledListBox(self,
!                                                                 'slistbox',
!                                                                 destroy_physically=0)
          self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox',
!                                                        destroy_physically=0)
  
  class _dummyDirList(DirList, TixSubWidget):