[Idle-dev] Re: [Pythonmac-SIG] readline

Tony Lownds tony@lownds.com
Mon, 2 Dec 2002 08:57:17 -0800


--============_-1173274252==_============
Content-Type: text/plain; charset="us-ascii" ; format="flowed"

Hi Nicholas,

At 8:53 PM -0600 11/30/02, Nicholas Riley wrote to Pythonmac-SIG:
>The idlefork (www.sourceforge.net/projects/idlefork) version of IDLE
>works fine under a framework build of Python 2.2.2, barring a couple
>of cosmetic issues.  Apply the attached patch to the latest CVS
>version of idlefork (fixes it to use pythonw and move the line/column
>numbers over to make room for the size box) and you should be all set.
>The changes aren't at all cleanly done but they work for me.

I'm taking a look now to update idlefork - thanks for posting this!

The only change where I noticed a cosmetic glitch showing up was the 
addition of padx=14 on the status bar. A fix *is* needed on Mac OS X. 
I'm wondering if I can just change it without a special case. The 
only side effect for non-OSX platforms should be a slightly wider 
"Col:" area in the status bar.

I'm reluctant to hardcode the Geneva font into IDLE, or even have 
logic specific to Mac OS X to change the font, as it just adds more 
special code. There is plenty of Mac OS X special code already!

Are there cosmetic glitches in the tree window on your computer, or 
do you just prefer Geneva?

-Tony
--============_-1173274252==_============
Content-Id: <a05111703ba10b8b8367b@[10.0.1.2].0.0>
Content-Type: text/plain; name="idle-python-2.2.2-patch.txt"; charset="us-ascii" ; format="flowed"
Content-Disposition: attachment; filename="idle-python-2.2.2-patch.txt"
 ; modification-date="Sat, 30 Nov 2002 21:04:31 -0800"

Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v
retrieving revision 1.35
diff -c -r1.35 EditorWindow.py
*** EditorWindow.py	23 Oct 2002 04:48:08 -0000	1.35
--- EditorWindow.py	1 Dec 2002 02:44:50 -0000
***************
*** 193,199 ****
           self.status_bar = self.MultiStatusBar(self.top)
           self.status_bar.set_label('column', 'Col: ?', side=RIGHT)
           self.status_bar.set_label('line', 'Ln: ?', side=RIGHT)
!         self.status_bar.pack(side=BOTTOM, fill=X)
           self.text.bind('<KeyRelease>', self.set_line_and_column)
           self.text.bind('<ButtonRelease>', self.set_line_and_column)
           self.text.after_idle(self.set_line_and_column)
--- 193,199 ----
           self.status_bar = self.MultiStatusBar(self.top)
           self.status_bar.set_label('column', 'Col: ?', side=RIGHT)
           self.status_bar.set_label('line', 'Ln: ?', side=RIGHT)
!         self.status_bar.pack(side=BOTTOM, fill=X, padx=14)
           self.text.bind('<KeyRelease>', self.set_line_and_column)
           self.text.bind('<ButtonRelease>', self.set_line_and_column)
           self.text.after_idle(self.set_line_and_column)
Index: MultiStatusBar.py
===================================================================
RCS file: /cvsroot/idlefork/idle/MultiStatusBar.py,v
retrieving revision 1.3
diff -c -r1.3 MultiStatusBar.py
*** MultiStatusBar.py	13 Jul 2001 17:52:08 -0000	1.3
--- MultiStatusBar.py	1 Dec 2002 02:44:50 -0000
***************
*** 10,16 ****

       def set_label(self, name, text='', side=LEFT):
           if not self.labels.has_key(name):
!             label = Label(self, bd=1, relief=SUNKEN, anchor=W)
               label.pack(side=side)
               self.labels[name] = label
           else:
--- 10,16 ----

       def set_label(self, name, text='', side=LEFT):
           if not self.labels.has_key(name):
!             label = Label(self, bd=1, relief=SUNKEN, anchor=W, 
font=('Geneva', 9, ''))
               label.pack(side=side)
               self.labels[name] = label
           else:
Index: PyShell.py
===================================================================
RCS file: /cvsroot/idlefork/idle/PyShell.py,v
retrieving revision 1.35
diff -c -r1.35 PyShell.py
*** PyShell.py	30 Nov 2002 18:49:10 -0000	1.35
--- PyShell.py	1 Dec 2002 02:44:53 -0000
***************
*** 285,293 ****
               #
               # Instead, find the executable by looking relative to
               # sys.prefix.
!             executable = os.path.join(sys.prefix, 'Resources',
!                                       'Python.app', 'Contents',
!                                       'MacOS', 'python')
               return executable
           else:
               return sys.executable
--- 285,294 ----
               #
               # Instead, find the executable by looking relative to
               # sys.prefix.
!             #executable = os.path.join(sys.prefix, 'Resources',
!             #                          'Python.app', 'Contents',
!             #                          'MacOS', 'python')
!             executable = os.path.join(sys.prefix, 'bin', 'python')
               return executable
           else:
               return sys.executable
Index: TreeWidget.py
===================================================================
RCS file: /cvsroot/idlefork/idle/TreeWidget.py,v
retrieving revision 1.5
diff -c -r1.5 TreeWidget.py
*** TreeWidget.py	30 Nov 2002 19:04:06 -0000	1.5
--- TreeWidget.py	1 Dec 2002 02:44:53 -0000
***************
*** 248,254 ****
               label = self.label
           except AttributeError:
               # padding carefully selected (on Windows) to match Entry widget:
!             self.label = Label(self.canvas, text=text, bd=0, padx=2, pady=2)
           if self.selected:
               self.label.configure(fg="white", bg="darkblue")
           else:
--- 248,254 ----
               label = self.label
           except AttributeError:
               # padding carefully selected (on Windows) to match Entry widget:
!             self.label = Label(self.canvas, text=text, bd=0, 
padx=2, pady=2, font=('', 11, ''))
           if self.selected:
               self.label.configure(fg="white", bg="darkblue")
           else:
Index: idle
===================================================================
RCS file: /cvsroot/idlefork/idle/idle,v
retrieving revision 1.3
diff -c -r1.3 idle
*** idle	17 Jul 2001 04:59:01 -0000	1.3
--- idle	1 Dec 2002 02:44:53 -0000
***************
*** 1,4 ****
! #! /usr/bin/env python

   import PyShell
   PyShell.main()
--- 1,4 ----
! #! /usr/bin/env pythonw

   import PyShell
   PyShell.main()

--============_-1173274252==_============--