[Python-checkins] python/dist/src/Demo/tix/samples Balloon.py, 1.2, 1.3 BtnBox.py, 1.2, 1.3 CmpImg.py, 1.2, 1.3 ComboBox.py, 1.2, 1.3 Control.py, 1.3, 1.4 DirList.py, 1.3, 1.4 DirTree.py, 1.2, 1.3 NoteBook.py, 1.2, 1.3 OptMenu.py, 1.2, 1.3 PanedWin.py, 1.1, 1.2 PopMenu.py, 1.2, 1.3 SHList1.py, 1.3, 1.4 SHList2.py, 1.3, 1.4 Tree.py, 1.2, 1.3

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Sun Jul 18 08:10:39 CEST 2004


Update of /cvsroot/python/python/dist/src/Demo/tix/samples
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30843/samples

Modified Files:
	Balloon.py BtnBox.py CmpImg.py ComboBox.py Control.py 
	DirList.py DirTree.py NoteBook.py OptMenu.py PanedWin.py 
	PopMenu.py SHList1.py SHList2.py Tree.py 
Log Message:
Whitespace normalization, via reindent.py.


Index: Balloon.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/Balloon.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Balloon.py	17 Mar 2002 18:19:13 -0000	1.2
--- Balloon.py	18 Jul 2004 06:10:36 -0000	1.3
***************
*** 18,22 ****
  import Tix
  
! TCL_ALL_EVENTS		= 0
  
  def RunSample (root):
--- 18,22 ----
  import Tix
  
! TCL_ALL_EVENTS          = 0
  
  def RunSample (root):

Index: BtnBox.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/BtnBox.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BtnBox.py	17 Mar 2002 18:19:13 -0000	1.2
--- BtnBox.py	18 Jul 2004 06:10:36 -0000	1.3
***************
*** 1,4 ****
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! # 
  # $Id$
  #
--- 1,4 ----
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! #
  # $Id$
  #
***************
*** 22,26 ****
      #
      top = Tix.Label(w, padx=20, pady=10, bd=1, relief=Tix.RAISED,
! 		    anchor=Tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget')
  
      # Create the button box and add a few buttons in it. Set the
--- 22,26 ----
      #
      top = Tix.Label(w, padx=20, pady=10, bd=1, relief=Tix.RAISED,
!                     anchor=Tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget')
  
      # Create the button box and add a few buttons in it. Set the
***************
*** 33,39 ****
      box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
      box.add('ok', text='OK', underline=0, width=5,
! 	    command=lambda w=w: w.destroy())
      box.add('close', text='Cancel', underline=0, width=5,
! 	    command=lambda w=w: w.destroy())
      box.pack(side=Tix.BOTTOM, fill=Tix.X)
      top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)
--- 33,39 ----
      box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
      box.add('ok', text='OK', underline=0, width=5,
!             command=lambda w=w: w.destroy())
      box.add('close', text='Cancel', underline=0, width=5,
!             command=lambda w=w: w.destroy())
      box.pack(side=Tix.BOTTOM, fill=Tix.X)
      top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)

Index: CmpImg.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/CmpImg.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CmpImg.py	17 Mar 2002 18:19:13 -0000	1.2
--- CmpImg.py	18 Jul 2004 06:10:36 -0000	1.3
***************
*** 1,4 ****
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! # 
  # $Id$
  #
--- 1,4 ----
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! #
  # $Id$
  #
***************
*** 23,33 ****
  "32 32 7 1",
  /* colors */
! " 	s None	c None",
! ".	c #000000000000",
! "X	c white",
! "o	c #c000c000c000",
! "O	c #404040",
! "+	c blue",
! "@	c red",
  /* pixels */
  "                                ",
--- 23,33 ----
  "32 32 7 1",
  /* colors */
! "       s None  c None",
! ".      c #000000000000",
! "X      c white",
! "o      c #c000c000c000",
! "O      c #404040",
! "+      c blue",
! "@      c red",
  /* pixels */
  "                                ",
***************
*** 70,78 ****
  "32 32 5 1",
  /* colors */
! " 	s None	c None",
! ".	c #000000000000",
! "X	c white",
! "o	c #c000c000c000",
! "O	c #800080008000",
  /* pixels */
  "                                ",
--- 70,78 ----
  "32 32 5 1",
  /* colors */
! "       s None  c None",
! ".      c #000000000000",
! "X      c white",
! "o      c #c000c000c000",
! "O      c #800080008000",
  /* pixels */
  "                                ",
***************
*** 147,154 ****
      w.img0 = Tix.Image('pixmap', data=network_pixmap)
      if not w.img0:
! 	w.img0 = Tix.Image('bitmap', data=network_bitmap)
      w.img1 = Tix.Image('pixmap', data=hard_disk_pixmap)
      if not w.img0:
! 	w.img1 = Tix.Image('bitmap', data=hard_disk_bitmap)
  
      hdd = Tix.Button(w, padx=4, pady=1, width=120)
--- 147,154 ----
      w.img0 = Tix.Image('pixmap', data=network_pixmap)
      if not w.img0:
!         w.img0 = Tix.Image('bitmap', data=network_bitmap)
      w.img1 = Tix.Image('pixmap', data=hard_disk_pixmap)
      if not w.img0:
!         w.img1 = Tix.Image('bitmap', data=hard_disk_bitmap)
  
      hdd = Tix.Button(w, padx=4, pady=1, width=120)
***************
*** 164,168 ****
      w.hdd_img.tk.call(str(w.hdd_img), 'add', 'line')
      w.hdd_img.tk.call(str(w.hdd_img), 'add', 'text', '-text', 'Hard Disk',
! 		    '-underline', '0')
      w.hdd_img.tk.call(str(w.hdd_img), 'add', 'space', '-width', '7')
      w.hdd_img.tk.call(str(w.hdd_img), 'add', 'image', '-image', w.img1)
--- 164,168 ----
      w.hdd_img.tk.call(str(w.hdd_img), 'add', 'line')
      w.hdd_img.tk.call(str(w.hdd_img), 'add', 'text', '-text', 'Hard Disk',
!                     '-underline', '0')
      w.hdd_img.tk.call(str(w.hdd_img), 'add', 'space', '-width', '7')
      w.hdd_img.tk.call(str(w.hdd_img), 'add', 'image', '-image', w.img1)
***************
*** 176,180 ****
      w.net_img.tk.call(str(w.net_img), 'add', 'line')
      w.net_img.tk.call(str(w.net_img), 'add', 'text', '-text', 'Network',
! 		    '-underline', '0')
      w.net_img.tk.call(str(w.net_img), 'add', 'space', '-width', '7')
      w.net_img.tk.call(str(w.net_img), 'add', 'image', '-image', w.img0)
--- 176,180 ----
      w.net_img.tk.call(str(w.net_img), 'add', 'line')
      w.net_img.tk.call(str(w.net_img), 'add', 'text', '-text', 'Network',
!                     '-underline', '0')
      w.net_img.tk.call(str(w.net_img), 'add', 'space', '-width', '7')
      w.net_img.tk.call(str(w.net_img), 'add', 'image', '-image', w.img0)
***************
*** 185,189 ****
  
      close = Tix.Button(w, pady=1, text='Close',
! 		       command=lambda w=w: w.destroy())
  
      hdd.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1)
--- 185,189 ----
  
      close = Tix.Button(w, pady=1, text='Close',
!                        command=lambda w=w: w.destroy())
  
      hdd.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1)
***************
*** 195,197 ****
      RunSample(root)
      root.mainloop()
-  
--- 195,196 ----

Index: ComboBox.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/ComboBox.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ComboBox.py	17 Mar 2002 18:19:13 -0000	1.2
--- ComboBox.py	18 Jul 2004 06:10:36 -0000	1.3
***************
*** 1,4 ****
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! # 
  # $Id$
  #
--- 1,4 ----
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! #
  # $Id$
  #
***************
*** 28,37 ****
      #
      # [Hint] The -options switch sets the options of the subwidgets.
!     # [Hint] We set the label.width subwidget option of both comboboxes to 
      #        be 10 so that their labels appear to be aligned.
      #
      a = Tix.ComboBox(top, label="Month: ", dropdown=1,
! 	command=select_month, editable=0, variable=demo_month,
! 	options='listbox.height 6 label.width 10 label.anchor e')
  
      # $w.top.b is a non-drop-down combo box. It is not editable: we provide
--- 28,37 ----
      #
      # [Hint] The -options switch sets the options of the subwidgets.
!     # [Hint] We set the label.width subwidget option of both comboboxes to
      #        be 10 so that their labels appear to be aligned.
      #
      a = Tix.ComboBox(top, label="Month: ", dropdown=1,
!         command=select_month, editable=0, variable=demo_month,
!         options='listbox.height 6 label.width 10 label.anchor e')
  
      # $w.top.b is a non-drop-down combo box. It is not editable: we provide
***************
*** 40,50 ****
      #
      # [Hint] Use the padY and anchor options of the label subwidget to
!     #	     align the label with the entry subwidget.
      # [Hint] Notice that you should use padY (the NAME of the option) and not
      #        pady (the SWITCH of the option).
      #
      b = Tix.ComboBox(top, label="Year: ", dropdown=0,
! 	command=select_year, editable=1, variable=demo_year,
! 	options='listbox.height 4 label.padY 5 label.width 10 label.anchor ne')
  
      a.pack(side=Tix.TOP, anchor=Tix.W)
--- 40,50 ----
      #
      # [Hint] Use the padY and anchor options of the label subwidget to
!     #        align the label with the entry subwidget.
      # [Hint] Notice that you should use padY (the NAME of the option) and not
      #        pady (the SWITCH of the option).
      #
      b = Tix.ComboBox(top, label="Year: ", dropdown=0,
!         command=select_year, editable=1, variable=demo_year,
!         options='listbox.height 4 label.padY 5 label.width 10 label.anchor ne')
  
      a.pack(side=Tix.TOP, anchor=Tix.W)
***************
*** 71,75 ****
  
      # Use "tixSetSilent" to set the values of the combo box if you
!     # don't want your -command procedures (cbx:select_month and 
      # cbx:select_year) to be called.
      #
--- 71,75 ----
  
      # Use "tixSetSilent" to set the values of the combo box if you
!     # don't want your -command procedures (cbx:select_month and
      # cbx:select_year) to be called.
      #
***************
*** 79,85 ****
      box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
      box.add('ok', text='Ok', underline=0, width=6,
! 	    command=lambda w=w: ok_command(w))
      box.add('cancel', text='Cancel', underline=0, width=6,
! 	    command=lambda w=w: w.destroy())
      box.pack(side=Tix.BOTTOM, fill=Tix.X)
      top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)
--- 79,85 ----
      box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
      box.add('ok', text='Ok', underline=0, width=6,
!             command=lambda w=w: ok_command(w))
      box.add('cancel', text='Cancel', underline=0, width=6,
!             command=lambda w=w: w.destroy())
      box.pack(side=Tix.BOTTOM, fill=Tix.X)
      top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)

Index: Control.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/Control.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Control.py	17 Mar 2002 18:19:13 -0000	1.3
--- Control.py	18 Jul 2004 06:10:36 -0000	1.4
***************
*** 21,25 ****
  import Tix
  
! TCL_ALL_EVENTS		= 0
  
  def RunSample (root):
--- 21,25 ----
  import Tix
  
! TCL_ALL_EVENTS          = 0
  
  def RunSample (root):
***************
*** 47,51 ****
          #
          # [Hint] The -options switch sets the options of the subwidgets.
!         # [Hint] We set the label.width subwidget option of the Controls to 
          #        be 16 so that their labels appear to be aligned.
          #
--- 47,51 ----
          #
          # [Hint] The -options switch sets the options of the subwidgets.
!         # [Hint] We set the label.width subwidget option of the Controls to
          #        be 16 so that their labels appear to be aligned.
          #
***************
*** 84,88 ****
          # tixDemo:Status "Selected %d of %s engines each of thrust %d", (demo_num_engines.get(), demo_maker.get(), demo_thrust.get())
          self.quitcmd()
!         
      def quitcmd (self):
          self.exit = 0
--- 84,88 ----
          # tixDemo:Status "Selected %d of %s engines each of thrust %d", (demo_num_engines.get(), demo_maker.get(), demo_thrust.get())
          self.quitcmd()
! 
      def quitcmd (self):
          self.exit = 0
***************
*** 101,107 ****
      i = i + inc
      if i >= len(maker_list):
! 	i = 0
      elif i < 0:
! 	i = len(maker_list) - 1
  
      # In Tcl/Tix we should return the string maker_list[i]. We can't
--- 101,107 ----
      i = i + inc
      if i >= len(maker_list):
!         i = 0
      elif i < 0:
!         i = len(maker_list) - 1
  
      # In Tcl/Tix we should return the string maker_list[i]. We can't
***************
*** 111,118 ****
  def validate_maker(w):
      try:
! 	i = maker_list.index(demo_maker.get())
      except ValueError:
! 	# Works here though. Why ? Beats me.
! 	return maker_list[0]
      # Works here though. Why ? Beats me.
      return maker_list[i]
--- 111,118 ----
  def validate_maker(w):
      try:
!         i = maker_list.index(demo_maker.get())
      except ValueError:
!         # Works here though. Why ? Beats me.
!         return maker_list[0]
      # Works here though. Why ? Beats me.
      return maker_list[i]

Index: DirList.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/DirList.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DirList.py	12 Feb 2004 17:35:03 -0000	1.3
--- DirList.py	18 Jul 2004 06:10:36 -0000	1.4
***************
*** 1,5 ****
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
  #
! #	$Id$
  #
  # Tix Demostration Program
--- 1,5 ----
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
  #
! #       $Id$
  #
  # Tix Demostration Program
***************
*** 20,24 ****
  from Tkconstants import *
  
! TCL_ALL_EVENTS		= 0
  
  def RunSample (root):
--- 20,24 ----
  from Tkconstants import *
  
! TCL_ALL_EVENTS          = 0
  
  def RunSample (root):
***************
*** 26,38 ****
      dirlist.mainloop()
      dirlist.destroy()
!     
  class DemoDirList:
      def __init__(self, w):
          self.root = w
          self.exit = -1
!         
          z = w.winfo_toplevel()
          z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
!         
          # Create the tixDirList and the tixLabelEntry widgets on the on the top
          # of the dialog box
--- 26,38 ----
      dirlist.mainloop()
      dirlist.destroy()
! 
  class DemoDirList:
      def __init__(self, w):
          self.root = w
          self.exit = -1
! 
          z = w.winfo_toplevel()
          z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
! 
          # Create the tixDirList and the tixLabelEntry widgets on the on the top
          # of the dialog box
***************
*** 49,53 ****
          top.dir = Tix.DirList(top)
          top.dir.hlist['width'] = 40
!         
          # When the user presses the ".." button, the selected directory
          # is "transferred" into the entry widget
--- 49,53 ----
          top.dir = Tix.DirList(top)
          top.dir.hlist['width'] = 40
! 
          # When the user presses the ".." button, the selected directory
          # is "transferred" into the entry widget
***************
*** 56,60 ****
  
          # We use a LabelEntry to hold the installation directory. The user
!         # can choose from the DirList widget, or he can type in the directory 
          # manually
          #
--- 56,60 ----
  
          # We use a LabelEntry to hold the installation directory. The user
!         # can choose from the DirList widget, or he can type in the directory
          # manually
          #
***************
*** 65,69 ****
                                    label.anchor w
                                    ''')
!         
          font = self.root.tk.eval('tix option get fixed_font')
          # font = self.root.master.tix_option_get('fixed_font')
--- 65,69 ----
                                    label.anchor w
                                    ''')
! 
          font = self.root.tk.eval('tix option get fixed_font')
          # font = self.root.master.tix_option_get('fixed_font')
***************
*** 130,132 ****
              text = text + line + '\n'
              d = tkMessageBox.showerror ( 'Tix Demo Error', text)
- 
--- 130,131 ----

Index: DirTree.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/DirTree.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DirTree.py	17 Mar 2002 18:19:13 -0000	1.2
--- DirTree.py	18 Jul 2004 06:10:36 -0000	1.3
***************
*** 1,5 ****
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
  #
! #	$Id$
  #
  # Tix Demostration Program
--- 1,5 ----
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
  #
! #       $Id$
  #
  # Tix Demostration Program
***************
*** 20,24 ****
  from Tkconstants import *
  
! TCL_ALL_EVENTS		= 0
  
  def RunSample (root):
--- 20,24 ----
  from Tkconstants import *
  
! TCL_ALL_EVENTS          = 0
  
  def RunSample (root):
***************
*** 31,35 ****
          self.root = w
          self.exit = -1
!         
          z = w.winfo_toplevel()
          z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
--- 31,35 ----
          self.root = w
          self.exit = -1
! 
          z = w.winfo_toplevel()
          z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
***************
*** 49,53 ****
          top.dir = Tix.DirTree(top)
          top.dir.hlist['width'] = 40
!         
          # When the user presses the ".." button, the selected directory
          # is "transferred" into the entry widget
--- 49,53 ----
          top.dir = Tix.DirTree(top)
          top.dir.hlist['width'] = 40
! 
          # When the user presses the ".." button, the selected directory
          # is "transferred" into the entry widget
***************
*** 56,60 ****
  
          # We use a LabelEntry to hold the installation directory. The user
!         # can choose from the DirTree widget, or he can type in the directory 
          # manually
          #
--- 56,60 ----
  
          # We use a LabelEntry to hold the installation directory. The user
!         # can choose from the DirTree widget, or he can type in the directory
          # manually
          #
***************
*** 116,118 ****
      root=Tix.Tk()
      RunSample(root)
- 
--- 116,117 ----

Index: NoteBook.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/NoteBook.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NoteBook.py	17 Mar 2002 18:19:13 -0000	1.2
--- NoteBook.py	18 Jul 2004 06:10:36 -0000	1.3
***************
*** 1,4 ****
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! # 
  # $Id$
  #
--- 1,4 ----
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! #
  # $Id$
  #
***************
*** 24,30 ****
      prefix = Tix.OptionName(w)
      if prefix:
! 	prefix = '*'+prefix
      else:
! 	prefix = ''
      w.option_add(prefix+'*TixControl*entry.width', 10)
      w.option_add(prefix+'*TixControl*label.width', 18)
--- 24,30 ----
      prefix = Tix.OptionName(w)
      if prefix:
!         prefix = '*'+prefix
      else:
!         prefix = ''
      w.option_add(prefix+'*TixControl*entry.width', 10)
      w.option_add(prefix+'*TixControl*label.width', 18)
***************
*** 38,49 ****
      nb['bg'] = 'gray'
      nb.nbframe['backpagecolor'] = 'gray'
! 	
      # Create the two tabs on the notebook. The -underline option
      # puts a underline on the first character of the labels of the tabs.
      # Keyboard accelerators will be defined automatically according
!     # to the underlined character.	
      nb.add('hard_disk', label="Hard Disk", underline=0)
      nb.add('network', label="Network", underline=0)
! 	
      nb.pack(expand=1, fill=Tix.BOTH, padx=5, pady=5 ,side=Tix.TOP)
  
--- 38,49 ----
      nb['bg'] = 'gray'
      nb.nbframe['backpagecolor'] = 'gray'
! 
      # Create the two tabs on the notebook. The -underline option
      # puts a underline on the first character of the labels of the tabs.
      # Keyboard accelerators will be defined automatically according
!     # to the underlined character.
      nb.add('hard_disk', label="Hard Disk", underline=0)
      nb.add('network', label="Network", underline=0)
! 
      nb.pack(expand=1, fill=Tix.BOTH, padx=5, pady=5 ,side=Tix.TOP)
  
***************
*** 57,89 ****
      f = Tix.Frame(tab)
      common = Tix.Frame(tab)
! 	
      f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1)
      common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y)
! 	
      a = Tix.Control(f, value=12,   label='Access time: ')
      w = Tix.Control(f, value=400,  label='Write Throughput: ')
      r = Tix.Control(f, value=400,  label='Read Throughput: ')
      c = Tix.Control(f, value=1021, label='Capacity: ')
! 	
      a.pack(side=Tix.TOP, padx=20, pady=2)
      w.pack(side=Tix.TOP, padx=20, pady=2)
      r.pack(side=Tix.TOP, padx=20, pady=2)
      c.pack(side=Tix.TOP, padx=20, pady=2)
! 	
      # Create the common buttons
      createCommonButtons(common)
! 	
      #----------------------------------------
!     # Create the second page	
      #----------------------------------------
! 	
      tab = nb.network
  
      f = Tix.Frame(tab)
      common = Tix.Frame(tab)
! 	
      f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1)
      common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y)
! 	
      a = Tix.Control(f, value=12,   label='Access time: ')
      w = Tix.Control(f, value=400,  label='Write Throughput: ')
--- 57,89 ----
      f = Tix.Frame(tab)
      common = Tix.Frame(tab)
! 
      f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1)
      common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y)
! 
      a = Tix.Control(f, value=12,   label='Access time: ')
      w = Tix.Control(f, value=400,  label='Write Throughput: ')
      r = Tix.Control(f, value=400,  label='Read Throughput: ')
      c = Tix.Control(f, value=1021, label='Capacity: ')
! 
      a.pack(side=Tix.TOP, padx=20, pady=2)
      w.pack(side=Tix.TOP, padx=20, pady=2)
      r.pack(side=Tix.TOP, padx=20, pady=2)
      c.pack(side=Tix.TOP, padx=20, pady=2)
! 
      # Create the common buttons
      createCommonButtons(common)
! 
      #----------------------------------------
!     # Create the second page
      #----------------------------------------
! 
      tab = nb.network
  
      f = Tix.Frame(tab)
      common = Tix.Frame(tab)
! 
      f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1)
      common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y)
! 
      a = Tix.Control(f, value=12,   label='Access time: ')
      w = Tix.Control(f, value=400,  label='Write Throughput: ')
***************
*** 91,95 ****
      c = Tix.Control(f, value=1021, label='Capacity: ')
      u = Tix.Control(f, value=10,   label='Users: ')
! 	
      a.pack(side=Tix.TOP, padx=20, pady=2)
      w.pack(side=Tix.TOP, padx=20, pady=2)
--- 91,95 ----
      c = Tix.Control(f, value=1021, label='Capacity: ')
      u = Tix.Control(f, value=10,   label='Users: ')
! 
      a.pack(side=Tix.TOP, padx=20, pady=2)
      w.pack(side=Tix.TOP, padx=20, pady=2)
***************
*** 97,103 ****
      c.pack(side=Tix.TOP, padx=20, pady=2)
      u.pack(side=Tix.TOP, padx=20, pady=2)
! 	
      createCommonButtons(common)
! 	
  def doDestroy():
      global root
--- 97,103 ----
      c.pack(side=Tix.TOP, padx=20, pady=2)
      u.pack(side=Tix.TOP, padx=20, pady=2)
! 
      createCommonButtons(common)
! 
  def doDestroy():
      global root
***************
*** 105,116 ****
  
  def createCommonButtons(master):
!     ok = Tix.Button(master, name='ok', text='OK', width=6, 
! 		command=doDestroy)
!     cancel = Tix.Button(master, name='cancel', 
! 		    text='Cancel', width=6, 
! 		    command=doDestroy)
!     
      ok.pack(side=Tix.TOP, padx=2, pady=2)
!     cancel.pack(side=Tix.TOP, padx=2, pady=2)	
  
  if __name__ == '__main__':
--- 105,116 ----
  
  def createCommonButtons(master):
!     ok = Tix.Button(master, name='ok', text='OK', width=6,
!                 command=doDestroy)
!     cancel = Tix.Button(master, name='cancel',
!                     text='Cancel', width=6,
!                     command=doDestroy)
! 
      ok.pack(side=Tix.TOP, padx=2, pady=2)
!     cancel.pack(side=Tix.TOP, padx=2, pady=2)
  
  if __name__ == '__main__':

Index: OptMenu.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/OptMenu.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** OptMenu.py	17 Mar 2002 18:19:13 -0000	1.2
--- OptMenu.py	18 Jul 2004 06:10:36 -0000	1.3
***************
*** 1,4 ****
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! # 
  # $Id$
  #
--- 1,4 ----
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! #
  # $Id$
  #
***************
*** 17,21 ****
  
  options = {'text':'Plain Text', 'post':'PostScript', 'html':'HTML',
! 	   'tex':'LaTeX', 'rtf':'Rich Text Format'}
  
  def RunSample(w):
--- 17,21 ----
  
  options = {'text':'Plain Text', 'post':'PostScript', 'html':'HTML',
!            'tex':'LaTeX', 'rtf':'Rich Text Format'}
  
  def RunSample(w):
***************
*** 28,47 ****
  
      from_file = Tix.OptionMenu(top, label="From File Format : ",
! 			       variable=demo_opt_from,
! 			       options = 'label.width  19 label.anchor e menubutton.width 15')
  
      to_file = Tix.OptionMenu(top, label="To File Format : ",
! 			     variable=demo_opt_to,
! 			     options='label.width  19 label.anchor e menubutton.width 15')
  
      # Add the available options to the two OptionMenu widgets
      #
      # [Hint] You have to add the options first before you set the
!     #	     global variables "demo_opt_from" and "demo_opt_to". Otherwise
!     #	     the OptionMenu widget will complain about "unknown options"!
      #
      for opt in options.keys():
! 	from_file.add_command(opt, label=options[opt])
! 	to_file.add_command(opt, label=options[opt])
  
      demo_opt_from.set('html')
--- 28,47 ----
  
      from_file = Tix.OptionMenu(top, label="From File Format : ",
!                                variable=demo_opt_from,
!                                options = 'label.width  19 label.anchor e menubutton.width 15')
  
      to_file = Tix.OptionMenu(top, label="To File Format : ",
!                              variable=demo_opt_to,
!                              options='label.width  19 label.anchor e menubutton.width 15')
  
      # Add the available options to the two OptionMenu widgets
      #
      # [Hint] You have to add the options first before you set the
!     #        global variables "demo_opt_from" and "demo_opt_to". Otherwise
!     #        the OptionMenu widget will complain about "unknown options"!
      #
      for opt in options.keys():
!         from_file.add_command(opt, label=options[opt])
!         to_file.add_command(opt, label=options[opt])
  
      demo_opt_from.set('html')
***************
*** 53,59 ****
      box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
      box.add('ok', text='Ok', underline=0, width=6,
! 	    command=lambda w=w: ok_command(w))
      box.add('cancel', text='Cancel', underline=0, width=6,
! 	    command=lambda w=w: w.destroy())
      box.pack(side=Tix.BOTTOM, fill=Tix.X)
      top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)
--- 53,59 ----
      box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
      box.add('ok', text='Ok', underline=0, width=6,
!             command=lambda w=w: ok_command(w))
      box.add('cancel', text='Cancel', underline=0, width=6,
!             command=lambda w=w: w.destroy())
      box.pack(side=Tix.BOTTOM, fill=Tix.X)
      top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)

Index: PanedWin.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/PanedWin.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PanedWin.py	25 Nov 2001 14:50:55 -0000	1.1
--- PanedWin.py	18 Jul 2004 06:10:36 -0000	1.2
***************
*** 18,22 ****
  import Tix
  
! TCL_ALL_EVENTS		= 0
  
  def RunSample (root):
--- 18,22 ----
  import Tix
  
! TCL_ALL_EVENTS          = 0
  
  def RunSample (root):

Index: PopMenu.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/PopMenu.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PopMenu.py	17 Mar 2002 18:19:13 -0000	1.2
--- PopMenu.py	18 Jul 2004 06:10:36 -0000	1.3
***************
*** 1,5 ****
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
  #
! #	$Id$
  #
  # Tix Demostration Program
--- 1,5 ----
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
  #
! #       $Id$
  #
  # Tix Demostration Program
***************
*** 28,34 ****
      p.bind_widget(but)
  
!     # Set the entries inside the PopupMenu widget. 
      # [Hint] You have to manipulate the "menu" subwidget.
!     #	     $w.top.p itself is NOT a menu widget.
      # [Hint] Watch carefully how the sub-menu is created
      #
--- 28,34 ----
      p.bind_widget(but)
  
!     # Set the entries inside the PopupMenu widget.
      # [Hint] You have to manipulate the "menu" subwidget.
!     #        $w.top.p itself is NOT a menu widget.
      # [Hint] Watch carefully how the sub-menu is created
      #
***************
*** 46,52 ****
      box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
      box.add('ok', text='Ok', underline=0, width=6,
! 	    command=lambda w=w: w.destroy())
      box.add('cancel', text='Cancel', underline=0, width=6,
! 	    command=lambda w=w: w.destroy())
      box.pack(side=Tix.BOTTOM, fill=Tix.X)
      top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)
--- 46,52 ----
      box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
      box.add('ok', text='Ok', underline=0, width=6,
!             command=lambda w=w: w.destroy())
      box.add('cancel', text='Cancel', underline=0, width=6,
!             command=lambda w=w: w.destroy())
      box.pack(side=Tix.BOTTOM, fill=Tix.X)
      top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)

Index: SHList1.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/SHList1.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SHList1.py	17 Mar 2002 18:19:13 -0000	1.3
--- SHList1.py	18 Jul 2004 06:10:36 -0000	1.4
***************
*** 1,4 ****
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! # 
  # $Id$
  #
--- 1,4 ----
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! #
  # $Id$
  #
***************
*** 16,20 ****
  import Tix
  
! TCL_ALL_EVENTS		= 0
  
  def RunSample (root):
--- 16,20 ----
  import Tix
  
! TCL_ALL_EVENTS          = 0
  
  def RunSample (root):
***************
*** 22,26 ****
      shlist.mainloop()
      shlist.destroy()
!     
  class DemoSHList:
      def __init__(self, w):
--- 22,26 ----
      shlist.mainloop()
      shlist.destroy()
! 
  class DemoSHList:
      def __init__(self, w):
***************
*** 30,34 ****
          z = w.winfo_toplevel()
          z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
!         
          # We create the frame and the ScrolledHList widget
          # at the top of the dialog box
--- 30,34 ----
          z = w.winfo_toplevel()
          z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
! 
          # We create the frame and the ScrolledHList widget
          # at the top of the dialog box
***************
*** 62,66 ****
          hlist=top.a.hlist
  
!         # Let configure the appearance of the HList subwidget 
          #
          hlist.config( separator='.', width=25, drawbranch=0, indent=10)
--- 62,66 ----
          hlist=top.a.hlist
  
!         # Let configure the appearance of the HList subwidget
          #
          hlist.config( separator='.', width=25, drawbranch=0, indent=10)
***************
*** 72,76 ****
                      bd=2, relief=Tix.SUNKEN )
  
!                 hlist.add_child( itemtype=Tix.WINDOW, 
                      window=f, state=Tix.DISABLED )
  
--- 72,76 ----
                      bd=2, relief=Tix.SUNKEN )
  
!                 hlist.add_child( itemtype=Tix.WINDOW,
                      window=f, state=Tix.DISABLED )
  
***************
*** 89,99 ****
  
              # [Hint] Make sure the keys (e.g. 'boss.person') you choose
!             #	 are unique names. If you cannot be sure of this (because of
!             #	 the structure of your database, e.g.) you can use the
!             #	 "add_child" command instead:
              #
              #  hlist.addchild( boss,  text=name)
              #                  ^^^^
!             #                  parent entryPath 
  
  
--- 89,99 ----
  
              # [Hint] Make sure the keys (e.g. 'boss.person') you choose
!             #    are unique names. If you cannot be sure of this (because of
!             #    the structure of your database, e.g.) you can use the
!             #    "add_child" command instead:
              #
              #  hlist.addchild( boss,  text=name)
              #                  ^^^^
!             #                  parent entryPath
  
  
***************
*** 130,132 ****
      root=Tix.Tk()
      RunSample(root)
- 
--- 130,131 ----

Index: SHList2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/SHList2.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SHList2.py	17 Mar 2002 18:19:13 -0000	1.3
--- SHList2.py	18 Jul 2004 06:10:36 -0000	1.4
***************
*** 1,4 ****
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! # 
  # $Id$
  #
--- 1,4 ----
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! #
  # $Id$
  #
***************
*** 14,23 ****
  # in the tixHList widget
  #
! # In a tixHList widget, you can have one ore more columns. 
  #
  
  import Tix
  
! TCL_ALL_EVENTS		= 0
  
  def RunSample (root):
--- 14,23 ----
  # in the tixHList widget
  #
! # In a tixHList widget, you can have one ore more columns.
  #
  
  import Tix
  
! TCL_ALL_EVENTS          = 0
  
  def RunSample (root):
***************
*** 25,29 ****
      shlist.mainloop()
      shlist.destroy()
!     
  class DemoSHList:
      def __init__(self, w):
--- 25,29 ----
      shlist.mainloop()
      shlist.destroy()
! 
  class DemoSHList:
      def __init__(self, w):
***************
*** 33,37 ****
          z = w.winfo_toplevel()
          z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
!         
          # We create the frame and the ScrolledHList widget
          # at the top of the dialog box
--- 33,37 ----
          z = w.winfo_toplevel()
          z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
! 
          # We create the frame and the ScrolledHList widget
          # at the top of the dialog box
***************
*** 48,52 ****
  
          # Create the title for the HList widget
!         #	>> Notice that we have set the hlist.header subwidget option to true
          #      so that the header is displayed
          #
--- 48,52 ----
  
          # Create the title for the HList widget
!         #       >> Notice that we have set the hlist.header subwidget option to true
          #      so that the header is displayed
          #
***************
*** 73,92 ****
          # This is our little relational database
          #
!         boss = ('doe', 'John Doe',	'Director')
  
          managers = [
!             ('jeff',  'Jeff Waxman',	'Manager'),
!             ('john',  'John Lee',		'Manager'),
!             ('peter', 'Peter Kenson',	'Manager')
          ]
  
          employees = [
!             ('alex',  'john',	'Alex Kellman',		'Clerk'),
!             ('alan',  'john',       'Alan Adams',		'Clerk'),
!             ('andy',  'peter',      'Andreas Crawford',	'Salesman'),
!             ('doug',  'jeff',       'Douglas Bloom',	'Clerk'),
!             ('jon',   'peter',      'Jon Baraki',		'Salesman'),
!             ('chris', 'jeff',       'Chris Geoffrey',	'Clerk'),
!             ('chuck', 'jeff',       'Chuck McLean',		'Cleaner')
          ]
  
--- 73,92 ----
          # This is our little relational database
          #
!         boss = ('doe', 'John Doe',      'Director')
  
          managers = [
!             ('jeff',  'Jeff Waxman',    'Manager'),
!             ('john',  'John Lee',               'Manager'),
!             ('peter', 'Peter Kenson',   'Manager')
          ]
  
          employees = [
!             ('alex',  'john',   'Alex Kellman',         'Clerk'),
!             ('alan',  'john',       'Alan Adams',               'Clerk'),
!             ('andy',  'peter',      'Andreas Crawford', 'Salesman'),
!             ('doug',  'jeff',       'Douglas Bloom',    'Clerk'),
!             ('jon',   'peter',      'Jon Baraki',               'Salesman'),
!             ('chris', 'jeff',       'Chris Geoffrey',   'Clerk'),
!             ('chuck', 'jeff',       'Chuck McLean',             'Cleaner')
          ]
  
***************
*** 99,103 ****
          style['empl_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist)
  
!         # Let configure the appearance of the HList subwidget 
          #
          hlist.config(separator='.', width=25, drawbranch=0, indent=10)
--- 99,103 ----
          style['empl_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist)
  
!         # Let configure the appearance of the HList subwidget
          #
          hlist.config(separator='.', width=25, drawbranch=0, indent=10)
***************
*** 125,132 ****
              # "." is the separator character we chose above
  
!             entrypath = '.' + mgr        + '.' + key 
  
              #           ^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^
!             #	    parent entryPath / child's name
  
              hlist.add(entrypath, text=name, style=style['empl_name'])
--- 125,132 ----
              # "." is the separator character we chose above
  
!             entrypath = '.' + mgr        + '.' + key
  
              #           ^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^
!             #       parent entryPath / child's name
  
              hlist.add(entrypath, text=name, style=style['empl_name'])
***************
*** 167,169 ****
      root=Tix.Tk()
      RunSample(root)
- 
--- 167,168 ----

Index: Tree.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/Tree.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Tree.py	17 Mar 2002 18:19:13 -0000	1.2
--- Tree.py	18 Jul 2004 06:10:36 -0000	1.3
***************
*** 1,4 ****
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! # 
  # $Id$
  #
--- 1,4 ----
  # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
! #
  # $Id$
  #
***************
*** 35,49 ****
  def adddir(tree, dir):
      if dir == '/':
! 	text = '/'
      else:
! 	text = os.path.basename(dir)
      tree.hlist.add(dir, itemtype=Tix.IMAGETEXT, text=text,
! 		   image=tree.tk.call('tix', 'getimage', 'folder'))
      try:
! 	os.listdir(dir)
! 	tree.setmode(dir, 'open')
      except os.error:
! 	# No read permission ?
! 	pass
  
  # This function is called whenever the user presses the (+) indicator or
--- 35,49 ----
  def adddir(tree, dir):
      if dir == '/':
!         text = '/'
      else:
!         text = os.path.basename(dir)
      tree.hlist.add(dir, itemtype=Tix.IMAGETEXT, text=text,
!                    image=tree.tk.call('tix', 'getimage', 'folder'))
      try:
!         os.listdir(dir)
!         tree.setmode(dir, 'open')
      except os.error:
!         # No read permission ?
!         pass
  
  # This function is called whenever the user presses the (+) indicator or
***************
*** 58,77 ****
      entries = tree.hlist.info_children(dir)
      if entries:
! 	# We have already loaded this directory. Let's just
! 	# show all the child entries
! 	#
! 	# Note: since we load the directory only once, it will not be
! 	#       refreshed if the you add or remove files from this
! 	#	directory.
! 	#
! 	for entry in entries:
! 	    tree.hlist.show_entry(entry)
      files = os.listdir(dir)
      for file in files:
! 	if os.path.isdir(dir + '/' + file):
! 	    adddir(tree, dir + '/' + file)
! 	else:
! 	    tree.hlist.add(dir + '/' + file, itemtype=Tix.IMAGETEXT, text=file,
! 			   image=tree.tk.call('tix', 'getimage', 'file'))
  
  if __name__ == '__main__':
--- 58,77 ----
      entries = tree.hlist.info_children(dir)
      if entries:
!         # We have already loaded this directory. Let's just
!         # show all the child entries
!         #
!         # Note: since we load the directory only once, it will not be
!         #       refreshed if the you add or remove files from this
!         #       directory.
!         #
!         for entry in entries:
!             tree.hlist.show_entry(entry)
      files = os.listdir(dir)
      for file in files:
!         if os.path.isdir(dir + '/' + file):
!             adddir(tree, dir + '/' + file)
!         else:
!             tree.hlist.add(dir + '/' + file, itemtype=Tix.IMAGETEXT, text=file,
!                            image=tree.tk.call('tix', 'getimage', 'file'))
  
  if __name__ == '__main__':



More information about the Python-checkins mailing list