Is there a way (in ver 2.4.2.4 for Python 2.3) to disable/lock the SplitterWindow sash so the user can't interact with it? I'd like to be able to use it programmatically but not interactively.
I've tried to include/redirect "EVT_SPLITTER_DCLICK(id, func)" but it errors out as undefined.
I've also tried creating a definition for "OnDoubleClickSash(int x, int y)", but it doesn't seem to be getting automatically called.
The wxWindows docs talk about calling Veto(), but don't explain (at my level) how that's accomplished.
Is there a way (in ver 2.4.2.4 for Python 2.3) to disable/lock the SplitterWindow sash so the user can't interact with it? I'd like to be able to use it programmatically but not interactively.
I've tried to include/redirect "EVT_SPLITTER_DCLICK(id, func)" but it errors out as undefined.
Looks like a doc error. Try EVT_SPLITTER_DOUBLECLICKED.
I've also tried creating a definition for "OnDoubleClickSash(int x, int y)", but it doesn't seem to be getting automatically called.
The wxWindows docs talk about calling Veto(), but don't explain (at my level) how that's accomplished.
Catch EVT_SPLITTER_SASH_POS_CHANGING (or _DOUBLECLICKED) and call event.Veto() from the handler.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I've tried using EVT_SPLITTER_DOUBLECLICKED and EVT_SPLITTER_SASH_POS_CHANGING on both Windows XP and Windows 2000 systems without any luck. I put a print statement in the handler to see if the function was being called or not - and it doesn't appear to be going out to the function at all. I'm probably calling Veto() improperly once I get there - but it doesn't matter yet since I can't seem to even get there.
def OnSash(self, event):
self.e = event
print CURRENT['menubar'] # or a string literal, it doesn't matter - I've tried both
self.e.Veto()
Robin Dunn wrote:
···
Rick Zoerner wrote:
Hi all,
Is there a way (in ver 2.4.2.4 for Python 2.3) to disable/lock the SplitterWindow sash so the user can't interact with it? I'd like to be able to use it programmatically but not interactively.
I've tried to include/redirect "EVT_SPLITTER_DCLICK(id, func)" but it errors out as undefined.
Looks like a doc error. Try EVT_SPLITTER_DOUBLECLICKED.
I've also tried creating a definition for "OnDoubleClickSash(int x, int y)", but it doesn't seem to be getting automatically called.
The wxWindows docs talk about calling Veto(), but don't explain (at my level) how that's accomplished.
Catch EVT_SPLITTER_SASH_POS_CHANGING (or _DOUBLECLICKED) and call event.Veto() from the handler.
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I've tried using EVT_SPLITTER_DOUBLECLICKED and EVT_SPLITTER_SASH_POS_CHANGING on both Windows XP and Windows 2000 systems without any luck. I put a print statement in the handler to see if the function was being called or not - and it doesn't appear to be going out to the function at all. I'm probably calling Veto() improperly once I get there - but it doesn't matter yet since I can't seem to even get there.
----- Original Message -----
From: Robin Dunn
To: wxPython-users@lists.wxwindows.org
Sent: Monday, December 29, 2003 4:30 PM
Subject: Re: [wxPython-users] Disable SplitterWindow sash
Rick Zoerner wrote:
> I've tried using EVT_SPLITTER_DOUBLECLICKED and EVT_SPLITTER_SASH_POS_CHANGING on both Windows XP and Windows 2000 systems without any luck. I put a print statement in the handler to see if the function was being called or not - and it doesn't appear to be going out to the function at all. I'm probably calling Veto() improperly once I get there - but it doesn't matter yet since I can't seem to even get there.
>
> class MainFrame(wxFrame):
> def __init__(self, *args, **kwds):
> kwds["style"] = wxDEFAULT_FRAME_STYLE
> wxFrame.__init__(self, *args, **kwds)
> ...........
> self.window_1 = wxSplitterWindow(self, -1, style=wxSP_3D|wxSP_FULLSASH)
Okay, so you're creating a splitter and it's ID will be generated, let's
say that it will be -204.