Phoenix: wx.Notebook pages

In an earlier version of wxPython to add pages to notebook tabs I created
panes, then added each pane to the notebook; e.g.,

     self.pane_1 = modProject(self, wx.ID_ANY)
     self.pane_2 = modComponent(self, wx.ID_ANY)
     self.pane_3 = modScoping(self, wx.ID_ANY)
     ...

     self.AddPage(self.pane_1, "Project")
     self.AddPage(self.pane_2, "Components")
     self.AddPage(self.pane_3, "Scoping")

   Looking at the 4.0.1 Notebook.py demo code it appears that panes are no
longer necessary; I can add each page directly. Is this correct?

   Related question: When should one use InsertPage rather than AddPage?

Rich

Hi,

As far I can remember adding a pane is for looking good in windows, please someone can confirm it?, at least in Linux you dont need it.

For your last question check here:

https://docs.wxpython.org/wx.aui.AuiNotebook.html?highlight=notebook%20insertpage#wx.aui.AuiNotebook.InsertPage

highlighted :
InsertPage is similar to AddPage, but allows the ability to specify the insert location

···

2018-04-20 17:21 GMT-05:00 Rich Shepard rshepard@appl-ecosys.com:

In an earlier version of wxPython to add pages to notebook tabs I created

panes, then added each pane to the notebook; e.g.,

self.pane_1 = modProject(self, wx.ID_ANY)

self.pane_2 = modComponent(self, wx.ID_ANY)

self.pane_3 = modScoping(self, wx.ID_ANY)

...



self.AddPage(self.pane_1, "Project")

self.AddPage(self.pane_2, "Components")

self.AddPage(self.pane_3, "Scoping")

Looking at the 4.0.1 Notebook.py demo code it appears that panes are no

longer necessary; I can add each page directly. Is this correct?

Related question: When should one use InsertPage rather than AddPage?

Rich

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Saludos / Best regards

Mario Lacunza
Email:: mlacunza@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru

I haven’t used wxPython in a while - but if
memory serves you need the pane to allow the tab key to work
correctly. I do recall that I always added a panel.

Johnf

···

On 04/20/2018 05:17 PM, Mario Lacunza
wrote:

Hi,

        As far I can remember adding a pane is for looking good in

windows, please someone can confirm it?, at least in Linux
you dont need it.

For your last question check here:

      [https://docs.wxpython.org/wx.aui.AuiNotebook.html?highlight=notebook%20insertpage#wx.aui.AuiNotebook.InsertPage](https://docs.wxpython.org/wx.aui.AuiNotebook.html?highlight=notebook%20insertpage#wx.aui.AuiNotebook.InsertPage)

highlighted :

    [`InsertPage`](https://docs.wxpython.org/wx.aui.AuiNotebook.html?highlight=notebook%20insertpage#wx.aui.AuiNotebook.InsertPage)
    is similar to AddPage, but allows the ability to specify the

insert location

Saludos / Best regards

                  Mario Lacunza

                  Email:: mlacunza@gmail.com

                  Personal Website:: [http://www.lacunza.biz/](http://www.lacunza.biz/)

                  Hosting:: [http://mlv-host.com/](http://mlv-host.com/)

                  Skype: mlacunzav



                  Lima - Peru
      2018-04-20 17:21 GMT-05:00 Rich Shepard

rshepard@appl-ecosys.com:

        In an

earlier version of wxPython to add pages to notebook tabs I
created

        panes, then added each pane to the notebook; e.g.,



            self.pane_1 = modProject(self, wx.ID_ANY)

            self.pane_2 = modComponent(self, wx.ID_ANY)

            self.pane_3 = modScoping(self, wx.ID_ANY)

            ...



            self.AddPage(self.pane_1, "Project")

            self.AddPage(self.pane_2, "Components")

            self.AddPage(self.pane_3, "Scoping")



          Looking at the 4.0.1 Notebook.py demo code it appears that

panes are no

        longer necessary; I can add each page directly. Is this

correct?

          Related question: When should one use InsertPage rather

than AddPage?

            Rich



            --

            You received this message because you are subscribed to

the Google Groups “wxPython-users” group.

            To unsubscribe from this group and stop receiving emails

from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

            For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

  You received this message because you are subscribed to the Google

Groups “wxPython-users” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to wxpython-users+unsubscribe@googlegroups.com.

  For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

In an earlier version of wxPython to add pages to notebook tabs I created

panes, then added each pane to the notebook; e.g.,

 self.pane_1 = modProject(self, wx.ID_ANY)

 self.pane_2 = modComponent(self, wx.ID_ANY)

 self.pane_3 = modScoping(self, wx.ID_ANY)

 ...



 self.AddPage(self.pane_1, "Project")

 self.AddPage(self.pane_2, "Components")

 self.AddPage(self.pane_3, "Scoping")

Looking at the 4.0.1 Notebook.py demo code it appears that panes are no

longer necessary; I can add each page directly. Is this correct?

If by “add each page directly” you mean something like this:

self.AddPage(modProject(self, wx.ID_ANY), “Project”)

Then there is nothing functionally different there than with the above, other than saving a reference to the modProject instance. If you don’t need access to that instance later on for some reason then there is no need to save it. But it doesn’t hurt anything to do so either. Mainly, it’s just a matter of choice, coding style, and what makes the most sense for you.

Related question: When should one use InsertPage rather than AddPage?

When you want to insert the page somewhere before the current last page. Just think of AddPage as if it was named AppendPage and it should make sense.

···

On Friday, April 20, 2018 at 3:21:18 PM UTC-7, Rich wrote:

Robin

If by "add each page directly" you mean something like this:

   self.AddPage(modProject(self, wx.ID_ANY), "Project")

Then there is nothing functionally different there than with the above,
other than saving a reference to the modProject instance. If you don't need
access to that instance later on for some reason then there is no need to
save it. But it doesn't hurt anything to do so either. Mainly, it's just a
matter of choice, coding style, and what makes the most sense for you.

Robin,

   Thanks for explaining. This project is different from what I've done in
the past so I don't now know what I want. :slight_smile: I need to read the wx.Grid API
and tutorial pages now.

   My objective with the MainFrame module (having the menu and status bar and
a notebook class) is to load a subject-specific grid in the panel of each
notebook tab to display data retrieved from the database tables (one row if
there are no available data), then display a dialog box to add/edit new
subject data as appropriate. More reading on my part is my focus.

   Related question: When should one use InsertPage rather than AddPage?

When you want to insert the page somewhere before the current last page.
Just think of AddPage as if it was named AppendPage and it should make
sense.

   This does clarify the difference between insert and add. Many thanks.

Best regards,

Rich

···

On Sat, 21 Apr 2018, Robin Dunn wrote: