AuiNotebook problem

Hello I’m now using wx on Mac and having trouble. When I make something like this, panel2 won’t open.
On Windows it works fine.

wx.APP

–wx.Frame
–wx.aui.AuiNotebook
–wx.Panel (panel 1)

        >--wx.Panel (panel 2)
              >--wx.Button

More precisely, panel2 opens first but panel1 opens again instantly.
When I set a callback to wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, I see it called twice.
I can open panel2 if I comment out wx.Button.

This is the code.

···

import wx, wx.aui

class MyFrame(wx.Frame):
def init(self, parent):
wx.Frame.init(self, parent)

    commandNB = wx.aui.AuiNotebook(self)
    scriptP = wx.Panel(commandNB)
    settingsP = wx.Panel(commandNB)
    wx.Button(settingsP)

    commandNB.AddPage(scriptP, "script")
    commandNB.AddPage(settingsP, "settings")

class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None)
frame.Show(True)
self.SetTopWindow(frame)
return True

app = MyApp(0)
app.MainLoop()

Has anybody experienced it? Or is there workaround.

If you know something about it, please let me know.

My wx version is

2.8.4.0 (mac-unicode)

and Python version is

2.5.1 (r251:54863, Feb 4 2008, 21:48:13)
[GCC 4.0.1 (Apple Inc. build 5465)]

  • Koichi

On windows xp with python 2.5.2 and wxPython '2.8.7.1 (msw-unicode)'
I'm not seeing the problem you are describing. Both panels are
displayed and I can switch back and forth between both of them.

--Mark

···

On Tue, Oct 28, 2008 at 11:30 PM, Koichi Tamura <hohehohe2@gmail.com> wrote:

Hello I'm now using wx on Mac and having trouble. When I make something like
this, panel2 won't open.
On Windows it works fine.

wx.APP
  >--wx.Frame
      >--wx.aui.AuiNotebook
            >--wx.Panel (panel 1)
            >--wx.Panel (panel 2)
                  >--wx.Button

More precisely, panel2 opens first but panel1 opens again instantly.
When I set a callback to wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, I see it
called twice.
I can open panel2 if I comment out wx.Button.

This is the code.
---------------------------------------
import wx, wx.aui

class MyFrame(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self, parent)

        commandNB = wx.aui.AuiNotebook(self)
        scriptP = wx.Panel(commandNB)
        settingsP = wx.Panel(commandNB)
        wx.Button(settingsP)

        commandNB.AddPage(scriptP, "script")
        commandNB.AddPage(settingsP, "settings")

class MyApp(wx.App):
    def OnInit(self):
        frame = MyFrame(None)
        frame.Show(True)
        self.SetTopWindow(frame)
        return True

app = MyApp(0)
app.MainLoop()
---------------------------------------

Has anybody experienced it? Or is there workaround.
If you know something about it, please let me know.

My wx version is

2.8.4.0 (mac-unicode)

and Python version is

2.5.1 (r251:54863, Feb 4 2008, 21:48:13)
[GCC 4.0.1 (Apple Inc. build 5465)]

- Koichi

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi Mark,

Yeah I tried it on xp and it worked too, but not on mac.

  • Koichi
···

2008/10/30 Mark Guagenti mgenti@gentiweb.com

On windows xp with python 2.5.2 and wxPython ‘2.8.7.1 (msw-unicode)’

I’m not seeing the problem you are describing. Both panels are

displayed and I can switch back and forth between both of them.

–Mark

On Tue, Oct 28, 2008 at 11:30 PM, Koichi Tamura hohehohe2@gmail.com wrote:

Hello I’m now using wx on Mac and having trouble. When I make something like

this, panel2 won’t open.

On Windows it works fine.

wx.APP

–wx.Frame

  >--wx.aui.AuiNotebook
        >--wx.Panel (panel 1)
        >--wx.Panel (panel 2)
              >--wx.Button

More precisely, panel2 opens first but panel1 opens again instantly.

When I set a callback to wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, I see it

called twice.

I can open panel2 if I comment out wx.Button.

This is the code.


import wx, wx.aui

class MyFrame(wx.Frame):

def __init__(self, parent):
    wx.Frame.__init__(self, parent)
    commandNB = wx.aui.AuiNotebook(self)
    scriptP = wx.Panel(commandNB)
    settingsP = wx.Panel(commandNB)
    wx.Button(settingsP)
    commandNB.AddPage(scriptP, "script")
    commandNB.AddPage(settingsP, "settings")

class MyApp(wx.App):

def OnInit(self):
    frame = MyFrame(None)
    frame.Show(True)
    self.SetTopWindow(frame)
    return True

app = MyApp(0)

app.MainLoop()


Has anybody experienced it? Or is there workaround.

If you know something about it, please let me know.

My wx version is

2.8.4.0 (mac-unicode)

and Python version is

2.5.1 (r251:54863, Feb 4 2008, 21:48:13)

[GCC 4.0.1 (Apple Inc. build 5465)]

  • Koichi

wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Koichi Tamura wrote:

Hello I'm now using wx on Mac and having trouble. When I make something like this, panel2 won't open.
On Windows it works fine.

wx.APP
  >--wx.Frame
      >--wx.aui.AuiNotebook
            >--wx.Panel (panel 1)
            >--wx.Panel (panel 2)
                  >--wx.Button

More precisely, panel2 opens first but panel1 opens again instantly.
When I set a callback to wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, I see it called twice.
I can open panel2 if I comment out wx.Button.

This is the code.
---------------------------------------
import wx, wx.aui

class MyFrame(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self, parent)

        commandNB = wx.aui.AuiNotebook(self)
        scriptP = wx.Panel(commandNB)
        settingsP = wx.Panel(commandNB)
        wx.Button(settingsP)

        commandNB.AddPage(scriptP, "script")
        commandNB.AddPage(settingsP, "settings")

class MyApp(wx.App):
    def OnInit(self):
        frame = MyFrame(None)
        frame.Show(True)
        self.SetTopWindow(frame)
        return True

app = MyApp(0)
app.MainLoop()
---------------------------------------

Has anybody experienced it? Or is there workaround.
If you know something about it, please let me know.

If you want the notebook to start with something other than the first page selected then you need to tell it to do so. If it is working otherwise in some situations then it is likely a bug that was fixed since the 2.8.4.0 version that you are using. This is the proper way to do it:

         commandNB.AddPage(settingsP, "settings", select=True)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin,
Hmm, I tried but the result was the same.
Anyway I decided to move the contents of a tab to a modeless dialog so it doesn’t happen now.
Thank you.

-Koichi

···

2008/11/1 Robin Dunn robin@alldunn.com

Koichi Tamura wrote:

Hello I’m now using wx on Mac and having trouble. When I make something like this, panel2 won’t open.

On Windows it works fine.

wx.APP

–wx.Frame

  >--wx.aui.AuiNotebook

        >--wx.Panel (panel 1)

        >--wx.Panel (panel 2)

              >--wx.Button

More precisely, panel2 opens first but panel1 opens again instantly.

When I set a callback to wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, I see it called twice.

I can open panel2 if I comment out wx.Button.

This is the code.


import wx, wx.aui

class MyFrame(wx.Frame):

def __init__(self, parent):

    wx.Frame.__init__(self, parent)



    commandNB = wx.aui.AuiNotebook(self)

    scriptP = wx.Panel(commandNB)

    settingsP = wx.Panel(commandNB)

    wx.Button(settingsP)



    commandNB.AddPage(scriptP, "script")

    commandNB.AddPage(settingsP, "settings")

class MyApp(wx.App):

def OnInit(self):

    frame = MyFrame(None)

    frame.Show(True)

    self.SetTopWindow(frame)

    return True

app = MyApp(0)

app.MainLoop()


Has anybody experienced it? Or is there workaround.

If you know something about it, please let me know.

If you want the notebook to start with something other than the first page selected then you need to tell it to do so. If it is working otherwise in some situations then it is likely a bug that was fixed since the 2.8.4.0 version that you are using. This is the proper way to do it:

    commandNB.AddPage(settingsP, "settings", select=True)

Robin Dunn

Software Craftsman

http://wxPython.org Java give you jitters? Relax with wxPython!


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users