I'm trying to put a Canvas inside a ScrolledWindow but I have a strange scroll movement when the Frame receives de Focus.
If you try the attached code and change the focus with another window, when the frame receive the focus makes an strange scroll movement automatically.
--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.
see the ScrolledWindow demo in the main wxPython demo -- it's a simple canvas.
Also, depending on what you want your "Canvas" to do, you may want to use an existing higher level drawing tools, like FloatCanvas or OGL
-CHB
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
see the ScrolledWindow demo in the main wxPython demo -- it's a simple canvas.
I have viewed the ScrolledWindow demo but i do not want a full ScrolledWindow canvas.
I'm tring to do a box inside the scroll window, with margins around, and use it as canvas.
···
--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.
see the ScrolledWindow demo in the main wxPython demo -- it's a simple canvas.
I have viewed the ScrolledWindow demo but i do not want a full ScrolledWindow canvas.
I'm tring to do a box inside the scroll window, with margins around, and use it as canvas.
What about the ScrolledPanel widget? Does that work for your use case?
I'm trying to put a Canvas inside a ScrolledWindow but I have a strange scroll movement when the Frame receives de Focus.
If you try the attached code and change the focus with another window, when the frame receive the focus makes an strange scroll movement automatically.
The scroll comes from the fact that wx.ScrolledWindow has gained some code like what we've had in wx.lib.scrolledpanel for a long time. It is now trying to move the focused child into view when it gains the focus. You can probably work around this by intercepting the EVT_CHILD_FOCUS event and not allowing it to get to the scrolled window.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I'm trying to put a Canvas inside a ScrolledWindow but I have a strange scroll movement when the Frame receives de Focus.
If you try the attached code and change the focus with another window, when the frame receive the focus makes an strange scroll movement automatically.
The scroll comes from the fact that wx.ScrolledWindow has gained some code like what we've had in wx.lib.scrolledpanel for a long time. It is now trying to move the focused child into view when it gains the focus. You can probably work around this by intercepting the EVT_CHILD_FOCUS event and not allowing it to get to the scrolled window.
Works
Thanks Robin.
···
--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.
see the ScrolledWindow demo in the main wxPython demo -- it's a simple canvas.
I have viewed the ScrolledWindow demo but i do not want a full ScrolledWindow canvas.
I'm tring to do a box inside the scroll window, with margins around, and use it as canvas.
What about the ScrolledPanel widget? Does that work for your use case?
The same issue.
Robin gave the the solution with EVT_CHILD_FOCUS.
Thanks.
···
--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.