[wxPython] wxFlexGridSizer usage

Hello everybody,
I am newbie to wxPython and have a question.
How can I achieve this using wxFlexGridSizer?

···

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

wxStaticText | wxTxtCtrl | wxStaticText | wxTextCtrl |

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

wxStaticText | wxTextCtrl |

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

wxStaticText | wxTextCtrl | wxStaticText|

--------------------------------------------------------
Thanks in advance

--
Best regards,
alienoid mailto:alienoid@is.lg.ua

Hello everybody!

How is the easiest way to synchronize two scrollbars?
I have two wxGrid, and the horizontal scrollbars of these have to be synchronized.

What I tried to do was to bind EVT_SCROLLWIN to both of them and then using event.GetPosition() to get the position of the actually scrolled one, and then use grid2.SetScrollPos(pos) to set the scrollbar of the other grid. This do change the position of the second scrollbar, BUT the problem is that the second grid is not updated. I've tried to call grid2.Refresh() and grid2.ForceRefresh(), but it doesn't help.

Thanks in advance!

-Jan-

I am newbie to wxPython and have a question.
How can I achieve this using wxFlexGridSizer?

--------------------------------------------------------
> wxStaticText | wxTxtCtrl | wxStaticText | wxTextCtrl |
--------------------------------------------------------
> wxStaticText | wxTextCtrl |
--------------------------------------------------------
> wxStaticText | wxTextCtrl | wxStaticText|
--------------------------------------------------------
Thanks in advance

I've adapted Niki's GridSizer a little bit and have added it to the wxPython
library for the next release. You can get the code from here:

http://cvs.wxwindows.org/cgi-bin/viewcvs.cgi/wxPython/wxPython/lib/rcsizer.p
y?rev=1.2&content-type=text/vnd.viewcvs-markup

And here is the demo:

http://cvs.wxwindows.org/cgi-bin/viewcvs.cgi/wxPython/demo/RowColSizer.py?re
v=1.2&content-type=text/vnd.viewcvs-markup

···

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

How is the easiest way to synchronize two scrollbars?
I have two wxGrid, and the horizontal scrollbars of these have to be
synchronized.

What I tried to do was to bind EVT_SCROLLWIN to both of them and then
using event.GetPosition() to get the position of the actually scrolled
one, and then use grid2.SetScrollPos(pos) to set the scrollbar of the
other grid. This do change the position of the second scrollbar, BUT the
problem is that the second grid is not updated. I've tried to call
grid2.Refresh() and grid2.ForceRefresh(), but it doesn't help.

You may want to try something like this instead:

    x, y = grid1.GetViewStart()
    grid2.Scroll(x, y)
    grid2.AdjustScrollbars()

···

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