[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GNUe-dev] GNUe & wxPython
From: |
Michael Klatt |
Subject: |
Re: [GNUe-dev] GNUe & wxPython |
Date: |
Tue, 10 Aug 2004 18:05:15 -0700 |
At 05:13 PM 8/10/2004 -0500, you wrote:
What problems are you seeing in GNUe Forms under 2.5? I was able to get most
of the bugs out of that combination, or at least I thought I did.
It's possible this bug could be specific to the Windows platform. I
didn't get this error when using wxPythonGTK2-py2.3-2.5.1.5-1 rpm (built
from src rpm) on Fedora Core 2.
Here's the output when trying to use gnue-forms with samples/intro/intro.gfd.
C:\GNUe\trunk\gnue-forms\samples\intro>"c:\program
files\python\scripts\gnue-forms.bat" intro.gfd
C:\GNUe\trunk\gnue-forms\samples\intro>python "c:\Program
Files\Python\Scripts\gnue-forms" intro.gfd
C:\Program Files\Python\lib\termios.py:7: DeprecationWarning: the TERMIOS
module is deprecated; please use termios DeprecationWarning)
DB000: Traceback (most recent call last):
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\forms\uidrivers\wx\widgets\form\wrappers.py",
line 154, in notebookTabHandler
DB000: self.uiform._eventHandler('requestPAGE',event.GetSelection(),
_form=self.form)
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\common\events\EventController.py", line
111, in dispatchEvent
DB000: handler(event)
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\forms\GFInstance.py", line 581, in gotoPage
DB000: self.dispatchEvent('gotoENTRY',object=event._form._currentEntry,
_form=event._form)
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\common\events\EventController.py", line
111, in dispatchEvent
DB000: handler(event)
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\forms\uidrivers\_base\UIdriver.py",
line 320, in switchFocus
DB000: self._uiFocusWidget.indexedFocus(object._visibleIndex)
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\forms\uidrivers\wx\widgets\_base.py",
line 99, in indexedFocus
DB000: widget = self.widgets[index]
DB000: IndexError: list index out of range
DB000: Traceback (most recent call last):
DB000: File "c:\Program Files\Python\Scripts\gnue-forms", line 34, in ?
DB000: client.run ()
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\forms\GFClient.py", line 171, in run
DB000: instance.activate()
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\forms\GFInstance.py", line 310, in activate
DB000: self.activateForm('__main__')
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\forms\GFInstance.py", line 330, in
activateForm
DB000: self.dispatchEvent ('gotoENTRY', object = form._currentEntry,
_form = form)
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\common\events\EventController.py", line
111, in dispatchEvent
DB000: handler(event)
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\forms\uidrivers\_base\UIdriver.py",
line 317, in switchFocus
DB000: self._uiFocusWidget.loseFocus()
DB000: File "C:\Program
Files\Python\Lib\site-packages\gnue\forms\uidrivers\wx\widgets\_base.py",
line 111, in loseFocus
DB000: widget.SetBackgroundColour(widget.__color)
DB000: AttributeError: 'TextCtrl' object has no attribute '_UIHelper__color'
I decided to try debugging the forms\uidrivers\wx\widgets\_base.py module
and discovered that if I apply the following changes to _base.py then
gnue-forms works just find for the intro.gfd.
$ diff -C 2 _base.py _base.py.new
*** _base.py Tue Aug 10 17:33:58 2004
--- _base.py.new Tue Aug 10 17:36:59 2004
***************
*** 97,100 ****
--- 97,104 ----
def indexedFocus(self, index):
+ ### Added by MK
+ if not self.widgets:
+ return
+
widget = self.widgets[index]
widget.__focused = True
***************
*** 109,115 ****
widget = self.widgets[self._uiDriver._uiFocusIndex]
widget.__focused = False
! widget.SetBackgroundColour(widget.__color)
def setValue(self, value, index=0, enabled=1):
# These must be here or dropdown style controls
# will get events they shouldn't and break.
--- 113,129 ----
widget = self.widgets[self._uiDriver._uiFocusIndex]
widget.__focused = False
!
! ### Added by MK
! try:
! widget.SetBackgroundColour(widget.__color)
! except:
! widget.__color = widget.GetBackgroundColour()
! widget.SetBackgroundColour(widget.__color)
def setValue(self, value, index=0, enabled=1):
+ ### Added by MK
+ if not self.widgets:
+ return
+
# These must be here or dropdown style controls
# will get events they shouldn't and break.
***************
*** 163,166 ****
--- 177,184 ----
pass # For label-style entries
+ ### Added by MK
+ except IndexError:
+ pass # not sure why this works
+
def setSelectedArea(self, selection1, selection2, index=0):
try:
I'm not sure if these changes alter the programs behavior, but they make
the error messages go away. :)
Michael Klatt