"DirBrowseButton" control crashses on win2k

Hi, group,
              I have python 2.3 and wxPython 2.4.2.4 installed on my win2k box. I just find whenenver I use "DirBrowseButton" control, it will crash with a 'memory could not be "written"' error. I exclude the possibility of the bug of my own code because bundled "demo" app also crashed when I clicked "FileBrowseButton" demo. However demo and my own code run well on linux box. Is this a wxPython bug or the problem of my win2k?

Thanks.

Chunlei

Hello all,

I have a dialog box made up of a series of wxTextCtrls. I've noticed that
as soon as I add the wxTE_MULTILINE style to one of the controls, it screws
up the tab order which worked fine with all single-line controls.
Specifically, tabbing through the form will skip the control AFTER the
Multi-line control. (Tabbing backwards through the list still works fine.)

Any ideas how I can fix this?

(I'm using Win2K, Python 2.2, and wxPython 2.4.2.4.)

Thanks,
David Woods
Wisconsin Center for Education Research
University of Wisconsin, Madison
http://www.transana.org

CL WU wrote:

Hi, group,
             I have python 2.3 and wxPython 2.4.2.4 installed on my win2k box. I just find whenenver I use "DirBrowseButton" control, it will crash with a 'memory could not be "written"' error. I exclude the possibility of the bug of my own code because bundled "demo" app also crashed when I clicked "FileBrowseButton" demo. However demo and my own code run well on linux box. Is this a wxPython bug or the problem of my win2k?

The attached patch will fix it.

fbb.patch (1.44 KB)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

David Woods wrote:

Hello all,

I have a dialog box made up of a series of wxTextCtrls. I've noticed that
as soon as I add the wxTE_MULTILINE style to one of the controls, it screws
up the tab order which worked fine with all single-line controls.
Specifically, tabbing through the form will skip the control AFTER the
Multi-line control. (Tabbing backwards through the list still works fine.)

Any ideas how I can fix this?

(I'm using Win2K, Python 2.2, and wxPython 2.4.2.4.)

This is a known problem, but I don't know of a workaround other than to not use a Dialog. Maybe putting the controls on a Panel and the Panel on the Dialog will work?

https://sourceforge.net/tracker/?group_id=9863&atid=109863&func=detail&aid=658026

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Putting everything on a Panel on the Dialog box worked perfectly.

Thanks, Robin.

David Woods

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Monday, January 05, 2004 2:18 PM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] wxTextCtrl, TE_MULTILINE, and Tab Order

David Woods wrote:

Hello all,

I have a dialog box made up of a series of wxTextCtrls. I've noticed that
as soon as I add the wxTE_MULTILINE style to one of the controls, it

screws

up the tab order which worked fine with all single-line controls.
Specifically, tabbing through the form will skip the control AFTER the
Multi-line control. (Tabbing backwards through the list still works

fine.)

Any ideas how I can fix this?

(I'm using Win2K, Python 2.2, and wxPython 2.4.2.4.)

This is a known problem, but I don't know of a workaround other than to
not use a Dialog. Maybe putting the controls on a Panel and the Panel
on the Dialog will work?

https://sourceforge.net/tracker/?group_id=9863&atid=109863&func=detail&aid=6
58026

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Thanks, Robin. Problem solved after applying this patch, except that "wx.ID_OK" on the patch should be "wxID_OK", instead.

Chunlei

Robin Dunn wrote:

···

CL WU wrote:

Hi, group,
             I have python 2.3 and wxPython 2.4.2.4 installed on my win2k box. I just find whenenver I use "DirBrowseButton" control, it will crash with a 'memory could not be "written"' error. I exclude the possibility of the bug of my own code because bundled "demo" app also crashed when I clicked "FileBrowseButton" demo. However demo and my own code run well on linux box. Is this a wxPython bug or the problem of my win2k?

The attached patch will fix it.

------------------------------------------------------------------------

Index: filebrowsebutton.py

RCS file: /pack/cvsroots/wxwindows/wxWindows/wxPython/wxPython/lib/filebrowsebutton.py,v
retrieving revision 1.8.2.2
diff -u -4 -r1.8.2.2 filebrowsebutton.py
--- filebrowsebutton.py 2003/02/26 18:38:15 1.8.2.2
+++ filebrowsebutton.py 2004/01/05 19:52:39
@@ -333,21 +333,19 @@
        FileBrowseButton.__init__(self, parent, id, pos, size, style,
                                  labelText, buttonText, toolTip,
                                  dialogTitle, startDirectory,
                                  changeCallback = changeCallback)
- #
- self._dirDialog = dialogClass(self,
- message = dialogTitle,
- defaultPath = startDirectory)
+ self.dialogClass = dialogClass
    #
+
    def OnBrowse(self, ev = None):
- dialog = self._dirDialog
- if dialog.ShowModal() == wxID_OK:
+ dialog = self.dialogClass(self,
+ message = self.dialogTitle,
+ defaultPath = self.startDirectory)
+ if dialog.ShowModal() == wx.ID_OK:
            self.SetValue(dialog.GetPath())
+ dialog.Destroy()
    #
- def __del__(self):
- if self.__dict__.has_key('_dirDialog'):
- self._dirDialog.Destroy()

#----------------------------------------------------------------------

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

CL WU wrote:

Thanks, Robin. Problem solved after applying this patch, except that "wx.ID_OK" on the patch should be "wxID_OK", instead.

Oops, that's what I get for just copy and pasting the fix from the 2.5 version to the 2.4 version.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!