[wxPython] wxSplitter Window: how to fix the sash ?

Hello to everybody,

i've just discovered the wxSplitterWindow and i'd like to fix the sash
position; reading the notice i've seen that i could use a the
overridabble function OnSashPositionChange which prevent the change by
returning FALSE;

my question is :how to define-override this function in my class
MyFrame(wxFrame) in which i created my splitter=wxSplitterWindows
embedding a panel and a noteboo?

I've noticed that i could use the event-handler Macro
EVT_SPLITTER_SASH_POS_CHANGED (i succeed in including it) but what to do
with it to fix my sash?

Thanks in advance,

···

--
Nicolas Baurin

Doctorant
Institut de Chimie Organique et Analytique, UPRES-A 6005
http://www.univ-orleans.fr/SCIENCES/ICOA/
Université d'Orléans, BP 6759
45067 ORLEANS Cedex 2, France
Tel: (33+) 2 38 49 45 77

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

I've noticed that i could use the event-handler Macro
EVT_SPLITTER_SASH_POS_CHANGED (i succeed in including it) but what to do
with it to fix my sash?

In your event handler call event.SetSashPosition(-1) to disallow the change.
You can also do the same thing in a handler (or the same one) for
EVT_SPLITTER_SASH_POS_CHANGING to disable the interactive update when
dragging the sash.

···

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

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

my question is :how to define-override this function in my class
MyFrame(wxFrame) in which i created my splitter=wxSplitterWindows
embedding a panel and a noteboo?

Excuse me if I've misunderstood your question.

You don't want to "define-override this function in my class
MyFrame(wxFrame) in which i created my splitter=wxSplitterWindows". You
define a NEW class, derived from wxSplitterWindow, in which you override
this function. Something like

class MySplitterWindow (wxSplitterWindow):
    def OnSashPositionChanged(event):
        pass # or rather, your code...

class MyFrame (wxFrame):
    def __init__(self,whatever):
        ...
        self.splitter = MySplitterWindow(self,-1)
        ...

Once again, sorry if I misunderstood your question (I don't THINK so
though?), and this is over-simple.

There ARE "introductory wxPython tutorials" out there which cover this sort
of thing; I think there's 1 somewhere on the O'Reilly Python pages...

Chris

···

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users