wx.Flatnotebook

Hello everybody,
i have a probably simple problem bothering me since hours.
I have got a wx.Splitterwindow with a wx.tree on one side and a
wx.Flatnotebook viewbook(FlatNotebook) on the other side.
The Projecthandler handler controls the tree and the viewbook.

I searching a way to hold different panels in the handler, use
MouseEvents from the tree and show and hide the panels as pages in the
notebook.
I did not find any decent docu on wx.FlatNotebook or any examples I can
use.
I can add Pages with self.viewbook.AddPage(panel1.....)
My Questions: How can I identify the pages in the Notebook to delete a
page or to prevent another tab from opening with the same panel.

Example: I get the mouseevent from a TreeItem and want a page with a
certain panel to be shown in the flatnotebook under the condition, that
it is not open yet.

self.viewbook.DeletePage(panel1 ),or RemovePage(panel1) wont work to
hide the page.

Can someone please point me to an example where I can see the problem,
or post some code?

Thanks for any help, jf

Hi,

Hello everybody, i have a probably simple problem bothering me since hours.
I have got a wx.Splitterwindow with a wx.tree on one side and a
wx.Flatnotebook viewbook(FlatNotebook) on the other side. The Projecthandler handler controls the tree and the viewbook.

I searching a way to hold different panels in the handler, use
MouseEvents from the tree and show and hide the panels as pages in the
notebook. I did not find any decent docu on wx.FlatNotebook or any examples I can
use. I can add Pages with self.viewbook.AddPage(panel1.....)
My Questions: How can I identify the pages in the Notebook to delete a
page or to prevent another tab from opening with the same panel.
  
I've never used the Flatnotebook, but if you do a little introspection on the object you'll find it has a GetChildren method. You can probably use that to get the pages in the notebook, although it will probably also return all the other widgets as well.

The wxPython Demo shows that you delete pages using the FlatNotebook's DeletePage() method. You can probably hide a page using Hide().

Example: I get the mouseevent from a TreeItem and want a page with a
certain panel to be shown in the flatnotebook under the condition, that
it is not open yet.

self.viewbook.DeletePage(panel1 ),or RemovePage(panel1) wont work to
hide the page.

Can someone please point me to an example where I can see the problem,
or post some code?

Thanks for any help, jf
  

HTH

ยทยทยท

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org