I have a problem hiding a toolbar.
My application is as such:
frame
toolbar
panel
SplitterWindow.
When I use toolbar.Hide() to
remove the toolbar I need the splitter to expand to fill the space that
the toolbar has made free but I can’t find a way to make this happen. Hide
just leaves a big blank space at the top of the frame where the toolbar
used to be. I’ve tried a few things, a Refresh() on the frame, panel,
splitter and everything else inbetween with no result. The panel
has a Sizer which I tried a Layout() on. Nothing works - what am
I doing wrong?
Thanks
Bones
···
NOTICE FROM DIMENSION DATA AUSTRALIA
This message is confidential, and may contain proprietary or legally privileged information. If you have received this email in error, please notify the sender and delete it immediately.
Internet communications are not secure. You should scan this message and any attachments for viruses. Under no circumstances do we accept liability for any loss or damage which may result from your receipt of this message or any attachments.
You will proabbly have to entirely remove the toolbar by calling frame.SetToolBar(None). Then you can either Destroy or Hide the toolbar.
···
Greg.Lucas-Smith@didata.com.au wrote:
Hi all,
I have a problem hiding a toolbar. My application is as such:
frame
toolbar
panel
SplitterWindow.
When I use toolbar.Hide() to remove the toolbar I need the splitter to expand to fill the space that the toolbar has made free but I can't find a way to make this happen. Hide just leaves a big blank space at the top of the frame where the toolbar used to be. I've tried a few things, a Refresh() on the frame, panel, splitter and everything else inbetween with no result. The panel has a Sizer which I tried a Layout() on. Nothing works - what am I doing wrong?
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I tried your suggestion and the frame did change, but rather that
fill the gap at the top of the frame, it made the main window (the
splitter) bigger at the bottom (past the bottom edge of the frame) and
still left a big blank spot at the top. Is this because the toolbar
still exists and the frame is allowing for it?
Any other ideas?
Thanks,
Bones
···
On Thu, 11 Nov 2004 22:23:15 +0100, Frank Niessink <frankn@cibit.nl> wrote:
Greg.Lucas-Smith@didata.com.au wrote:
>
> Hi all,
>
> I have a problem hiding a toolbar.
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
On Fri, 12 Nov 2004 08:45:40 +0800, Greg Lucas-Smith <bwobbones@gmail.com> wrote:
Thanks for your reply!
I tried your suggestion and the frame did change, but rather that
fill the gap at the top of the frame, it made the main window (the
splitter) bigger at the bottom (past the bottom edge of the frame) and
still left a big blank spot at the top. Is this because the toolbar
still exists and the frame is allowing for it?
Any other ideas?
Thanks,
Bones
On Thu, 11 Nov 2004 22:23:15 +0100, Frank Niessink <frankn@cibit.nl > wrote:
> Greg.Lucas-Smith@didata.com.au wrote:
> >
> > Hi all,
> >
> > I have a problem hiding a toolbar.
>
> This is what I use:
>
> def toggleToolbar(self, event):
> self.GetToolBar().Show(event.IsChecked())
> self.SendSizeEvent()
>
> self is the main window of the app (a subclass of wx.Frame). It is
> called from a checkable menu item.
>
> The same works for the statusbar btw:
>
> def toggleStatusBar(self, event):
> self.GetStatusBar().Show(event.IsChecked())
> self.SendSizeEvent()
>
> Cheers, Frank
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
>
>
Nothing happens. It doesn't even push the splitterwindow down as I
described. Could the splitter be controlling it's own starting
position? I thought the frame would do that, but obviously not! Any
other ideas?
Bones
···
On Fri, 12 Nov 2004 21:16:12 +0100, Frank Niessink <frankn@cibit.nl> wrote:
Greg Lucas-Smith wrote:
> Heres the code for the problem below, man this is frustrating!
>
> self.SetToolBar(None)
> self.toolbar.Show(False)
> self.SendSizeEvent()
>
> Where self is obviously the frame.
What happens if you remove the first line? So just:
self.toolbar.Show(False)
self.SendSizeEvent()
Cheers, Frank
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
On Sun, 14 Nov 2004 20:13:48 +0800, Greg Lucas-Smith <bwobbones@gmail.com> wrote:
Nothing happens. It doesn't even push the splitterwindow down as I
described. Could the splitter be controlling it's own starting
position? I thought the frame would do that, but obviously not! Any
other ideas?
Bones
On Fri, 12 Nov 2004 21:16:12 +0100, Frank Niessink <frankn@cibit.nl > wrote:
> Greg Lucas-Smith wrote:
> > Heres the code for the problem below, man this is frustrating!
> >
> > self.SetToolBar(None)
> > self.toolbar.Show(False)
> > self.SendSizeEvent()
> >
> > Where self is obviously the frame.
>
> What happens if you remove the first line? So just:
>
>
>
> self.toolbar.Show(False)
> self.SendSizeEvent()
>
> Cheers, Frank
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
>
>
Nothing happens. It doesn't even push the splitterwindow down as I
described. Could the splitter be controlling it's own starting
position? I thought the frame would do that, but obviously not! Any
other ideas?
Could you post a short, but complete, sample that demonstrates the problem?
Thanks for the update, but a question about the overhead of destroying/creating a toolbar everytime? The app I'm writing that inspired this question has quite a complex toolbar, when I do as you suggest there is a noticable flicker in the window. Is there any other way?
Yes. Don't allow the frame to manage the toolbar itself, (don't use CreateToolBar or SetToolBar.) Instead use a sizer to manage the size and placement of the toolbar and the panel yourself, and call sizer.Hide(toolbar) or sizer.Show(toolbar)
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Yes. Don't allow the frame to manage the toolbar itself, (don't use CreateToolBar or SetToolBar.) Instead use a sizer to manage the size and placement of the toolbar and the panel yourself
There is an example of this in the Wiki
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
All with no effect - the buttons appear on the screen but won't click or show any sign of being a button (or useful at all). I'm really trying here!
Bones.
Chris Barker wrote:
···
Robin Dunn wrote:
Yes. Don't allow the frame to manage the toolbar itself, (don't use CreateToolBar or SetToolBar.) Instead use a sizer to manage the size and placement of the toolbar and the panel yourself