Hi,

I am developing a cross platform gui to be used under both Windows and
Linux. I mainly program in Linux and test occassionally under Windows.
Generally it works flawlessly, I just double click on <program>.py in
windows and everything works without change (The files are exactly the same,
they are mounted from samba under both OS).

Unfortunately I developed a problem recently -
* Under Linux all still works as expected
* Under windows almost everything is displayed as expected, EXCEPT that I
cannot manipulate the controls (ie I try clicking on them and nothing
happens) including the scrollbars of the frame.
* Under windows, if I resize the frame the scrollbars starts working, but
the controls are still "stuck"
* Under windows, sometimes the controls are not displayed correctly (it
seems that it is behind some other controls)

In the program the controls are generated on the fly, hence the number of
them changes with each invocation of the program depending on the data.
The frame that contains the controls "stays around" while its children are
added and removed (children includes other frames and controls bounded by
sizers)

If anyone has experience this before I would appreciate some hints. I am
now going throught the tedious process of rolling back my code to see when
it occurred.

My platforms are -

Python 2.2.1
wxPython 2.4.0.1u
Windows 2000 version 5.00.2195 (SP3)

python-2.2-9mdk (rpm) (its python 2.2.1 I think)
wxPython 2.4.0.1u
Linux Mandrake 8.2 (Linux 2.4.19)

Thanks in advance,
Robert

I have spent a considerable amount of time working on similar issues as
I also develop a few applications which are intended to run on both
Linux and Windows, with my primary development platform being Linux. I
have generally found that Windows is more "picky" about following proper
coding techniques (according to the wxWindows standards) whereas the
Linux platfrom behaves as "expected". The majority of the troubles I
found are

1) forgetting to call event.Skip() in event handlers which Windows is
not very forgiving about

2) trying to perform certain GUI operations in an event handler which
Windows also doesn't like -- use wxCallAfter to solve this problem

Besides these two problems, everything has worked flawlessly. Hope those
two points point you in the right direction.... :slight_smile:

···

On Tue, 2003-03-18 at 18:13, Robert.Cheung@csiro.au wrote:

Hi,

I am developing a cross platform gui to be used under both Windows and
Linux. I mainly program in Linux and test occassionally under Windows.
Generally it works flawlessly, I just double click on <program>.py in
windows and everything works without change (The files are exactly the same,
they are mounted from samba under both OS).

Unfortunately I developed a problem recently -
* Under Linux all still works as expected
* Under windows almost everything is displayed as expected, EXCEPT that I
cannot manipulate the controls (ie I try clicking on them and nothing
happens) including the scrollbars of the frame.
* Under windows, if I resize the frame the scrollbars starts working, but
the controls are still "stuck"
* Under windows, sometimes the controls are not displayed correctly (it
seems that it is behind some other controls)

In the program the controls are generated on the fly, hence the number of
them changes with each invocation of the program depending on the data.
The frame that contains the controls "stays around" while its children are
added and removed (children includes other frames and controls bounded by
sizers)

If anyone has experience this before I would appreciate some hints. I am
now going throught the tedious process of rolling back my code to see when
it occurred.

My platforms are -

Python 2.2.1
wxPython 2.4.0.1u
Windows 2000 version 5.00.2195 (SP3)

python-2.2-9mdk (rpm) (its python 2.2.1 I think)
wxPython 2.4.0.1u
Linux Mandrake 8.2 (Linux 2.4.19)

Thanks in advance,
Robert

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

--
Anthony Tuininga <anthony@computronix.com>

I've seen this before when there is a window with an incorrect parent, or something similar. Double check your window heirarchy.

···

Robert.Cheung@csiro.au wrote:

Unfortunately I developed a problem recently -
* Under Linux all still works as expected
* Under windows almost everything is displayed as expected, EXCEPT that I
cannot manipulate the controls (ie I try clicking on them and nothing
happens) including the scrollbars of the frame.
* Under windows, if I resize the frame the scrollbars starts working, but
the controls are still "stuck"
* Under windows, sometimes the controls are not displayed correctly (it
seems that it is behind some other controls)

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

Anthony Tuininga wrote:

I have spent a considerable amount of time working on similar issues as
I also develop a few applications which are intended to run on both
Linux and Windows, with my primary development platform being Linux.

:slight_smile: - but from other side, my primary platform is windows, now i'm trying to port my code to linux - over 150000 lines of python source and 70000 lines of xrc files

> I have generally found that Windows is more "picky" about following proper

coding techniques (according to the wxWindows standards) whereas the
Linux platfrom behaves as "expected".

With some patches windows works beautyfull but not linux ;(

The majority of the troubles I found are:

1. using non sizer based windows is useless
2. wxCallAfter not always works or produces incredible results
3. playing with focus from focus handler is dangerous on both platforms

Besides these two problems, everything has worked flawlessly. Hope those
two points point you in the right direction.... :slight_smile:

Yep, thanks to wxPython

···

--

Pozdrawiam,
Grzegorz Makarewicz

---------------------------------------------------------------------
-- "Linux is more compatible with Windows than Windows with Windows."
---------------------------------------------------------------------

Grzegorz Makarewicz wrote:

With some patches windows works beautyfull but not linux ;(

The majority of the troubles I found are:

1. using non sizer based windows is useless

Yep, brute force sizing and layout definitly does not cross platforms very well. That's the main reason why we have things like sizers.

2. wxCallAfter not always works or produces incredible results

Do you have any examples of this?

3. playing with focus from focus handler is dangerous on both platforms

Not necessarily dangerous, but certainly tricky...

···

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

Robin Dunn wrote:

Grzegorz Makarewicz wrote:

2. wxCallAfter not always works or produces incredible results

Do you have any examples of this?

1 case:
  tab into t3 several times (works?) then (r)click on t3, now try tabbing elsewhere (works ?)

2 case:
  remove comment
  tab into t3 several times

3 case:
  remove comment
  click on t3 - try tabbing (1 case)

my configuration:
python 2.2.2
wxpython 2.4.0.6
linux rh-7.2
gtk-1.2

···

#
from wxPython.wx import *

class MyFrame(wxFrame):
     def __init__(self, parent, id, title):
         wxFrame.__init__(self, parent, id, title,
             wxPoint(100, 100), wxSize(360, 240))
         self.panel = MyPanel(self)
         EVT_CLOSE(self,self.OnCloseWindow)

     def OnCloseWindow(self, event):
         self.Destroy()

class MyPanel(wxPanel):
     def __init__(self,window):
         wxPanel.__init__(self,window,-1)

         self.t1 = wxTextCtrl(self,-1,"",(10,20),(240,-1))
         self.t2 = wxTextCtrl(self,-1,"",(10,50),(240,-1))
         self.t3 = wxTextCtrl(self,-1,"",(10,80),(240,-1))

         EVT_SET_FOCUS(self.t3,self.OnSetFocus3)
         self.t1.SetFocus()

     def OnSetFocus3(self,event):
         # what happen when next line is uncommented ?
# self.t1.SetFocus()
         wxCallAfter(self.OnCallAfter)

     def OnCallAfter(self):
         self.t1.SetFocus()
         self.MessageBox("Skip","Moving to t1",wxOK)

     def MessageBox(self,title,msg,type):
         return wxMessageDialog(self,msg,title,type).ShowModal()

class MyApp(wxApp):
     def OnInit(self):
         frame = MyFrame(NULL, -1, "This is a test")
         frame.Show(True)
         self.SetTopWindow(frame)
         return True

def run():
     app = MyApp(0)
     app.MainLoop()

if __name__ == '__main__':
     run()

--

Pozdrawiam,
Grzegorz Makarewicz

---------------------------------------------------------------------
-- "Linux is more compatible with Windows than Windows with Windows."
---------------------------------------------------------------------

Grzegorz Makarewicz wrote:

Robin Dunn wrote:

Grzegorz Makarewicz wrote:

2. wxCallAfter not always works or produces incredible results

Do you have any examples of this?

1 case:
tab into t3 several times (works?) then (r)click on t3, now try tabbing elsewhere (works ?)

Ah, I thought you meant there was a problem with wxCallAfter itself, not the mouse-focus-dialog interaction problems.

···

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