FAQ
I want to add a control Panel on the left side.
In this Panel I want a Notebook filling the whole available space.
Unfortunately the notebook remains very small, too small for placing
controls inside.
What can I do that the notebook always fills the whole available area,
independent of the parents size?

class NavPanel(wxPanel):

def __init__(self, parent, ID, doodle):
wxPanel.__init__(self, parent, -1)

self.notebook = wxNotebook(self, -1, style=wxNB_BOTTOM)

win = wxPanel(self, -1)

self.notebook.AddPage(win, "Config")


Thanks,

Markus

Search Discussions

  • Lexy Zhitenev at Jan 21, 2003 at 4:56 pm
    "Markus von Ehr" <markus.vonehr at ipm.fhg.de> ???????/???????? ? ????????
    ?????????: news:3E2D1E57.19CC5FC4 at ipm.fhg.de...
    I want to add a control Panel on the left side.
    In this Panel I want a Notebook filling the whole available space.
    Unfortunately the notebook remains very small, too small for placing
    controls inside.
    What can I do that the notebook always fills the whole available area,
    independent of the parents size?
    Yes, sizers and layouts don't work for wxNotebook. I hope it will be fixed
    in the next versions. The only thing I can propose is to use code like that.
    I use this variant:

    nb = wxNotebook(self, -1, (0, 0), size=self.GetClientSize(), style wxNB_BOTTOM)
    def OnFrameSize(evt, self=self, nb=nb):
    nb.SetSize(self.GetClientSize())
    EVT_SIZE(self, OnFrameSize)

    This works for all cases, at least in Windows. self here is wxNotebook
    parent.

    Best regards, Lexy.
  • Mel Wilson at Jan 21, 2003 at 6:38 pm
    In article <b0ju52$1nmi$1 at serv.vrn.ru>,
    "Lexy Zhitenev" wrote:
    "Markus von Ehr" <markus.vonehr at ipm.fhg.de> ???????/???????? ? ????????
    ?????????: news:3E2D1E57.19CC5FC4 at ipm.fhg.de...
    I want to add a control Panel on the left side.
    In this Panel I want a Notebook filling the whole available space.
    Unfortunately the notebook remains very small, too small for placing
    controls inside.
    What can I do that the notebook always fills the whole available area,
    independent of the parents size?
    Yes, sizers and layouts don't work for wxNotebook. I hope it will be fixed
    in the next versions.
    Would wxNotebookSizer work? I've used it with a tabbed
    notebook in a panel in a fairly naive way, and haven't had
    any problems like the Orioginal Poster's.

    Regards. Mel.
  • Markus von Ehr at Jan 22, 2003 at 10:24 am
    Thanks!

    It works perfect.

    Markus


    Lexy Zhitenev schrieb:
    "Markus von Ehr" <markus.vonehr at ipm.fhg.de> ???????/???????? ? ????????
    ?????????: news:3E2D1E57.19CC5FC4 at ipm.fhg.de...
    I want to add a control Panel on the left side.
    In this Panel I want a Notebook filling the whole available space.
    Unfortunately the notebook remains very small, too small for placing
    controls inside.
    What can I do that the notebook always fills the whole available area,
    independent of the parents size?
    Yes, sizers and layouts don't work for wxNotebook. I hope it will be fixed
    in the next versions. The only thing I can propose is to use code like that.
    I use this variant:

    nb = wxNotebook(self, -1, (0, 0), size=self.GetClientSize(), style =
    wxNB_BOTTOM)
    def OnFrameSize(evt, self=self, nb=nb):
    nb.SetSize(self.GetClientSize())
    EVT_SIZE(self, OnFrameSize)

    This works for all cases, at least in Windows. self here is wxNotebook
    parent.

    Best regards, Lexy.
  • Vadim Zeitlin at Jan 22, 2003 at 11:35 am

    On Tue, 21 Jan 2003 19:56:45 +0300, Lexy Zhitenev wrote:
    Yes, sizers and layouts don't work for wxNotebook. I hope it will be fixed
    in the next versions.
    There are no known [to me] problems with using either the sizers or layout
    constraints with wxNotebook and, in fact, I do it regularily in my code.

    The code of the OP had a problem: the notebook page wasn't created with the
    notebook as the parent (it must be). Maybe this explains the problems he has
    had.
    The only thing I can propose is to use code like that.
    I use this variant:

    nb = wxNotebook(self, -1, (0, 0), size=self.GetClientSize(), style =
    wxNB_BOTTOM)
    def OnFrameSize(evt, self=self, nb=nb):
    nb.SetSize(self.GetClientSize())
    EVT_SIZE(self, OnFrameSize)
    If you want wxNotebook to take up the entire client area of the frame, you
    don't need to do anything at all -- this will happen by default.

    Regards,
    VZ
    --
    GCS/GM d? H+ s++:-- p2 au--- a- w+ v C+++ UBLS+++ P- L++ N++ E--- W++++ M? V--
    -po+ R++ G`` !tv b+++ D--- e++++ u++ h--- f+ r++ n- y?

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJan 21, '03 at 10:17a
activeJan 22, '03 at 11:35a
posts5
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase