Why there is a "Window" menu in the MenuBar?

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Locked
lephon
Earned a small fee
Earned a small fee
Posts: 15
Joined: Tue Oct 28, 2008 3:20 am

Why there is a "Window" menu in the MenuBar?

Post by lephon »

Code: Select all

import wx
import wx.aui

class ParentFrame(wx.aui.AuiMDIParentFrame):
    def __init__(self, parent):
        wx.aui.AuiMDIParentFrame.__init__(self, parent, -1,
                                          title="AuiMDIParentFrame",
                                          size=(640,480),
                                          style=wx.DEFAULT_FRAME_STYLE)
        self.count = 0
        mb = self.MakeMenuBar()
        self.SetMenuBar(mb)
        self.CreateStatusBar()

    def MakeMenuBar(self):
        mb = wx.MenuBar()
        menu = wx.Menu()
        item = menu.Append(-1, "New child window\tCtrl-N")
        self.Bind(wx.EVT_MENU, self.OnNewChild, item)
        item = menu.Append(-1, "Close parent")
        self.Bind(wx.EVT_MENU, self.OnDoClose, item)
        mb.Append(menu, "&File")
        return mb

    def OnNewChild(self, evt):
        self.count += 1
        child = ChildFrame(self, self.count)
        child.Show()

    def OnDoClose(self, evt):
        self.Close()


class ChildFrame(wx.aui.AuiMDIChildFrame):
    def __init__(self, parent, count):
        wx.aui.AuiMDIChildFrame.__init__(self, parent, -1,
                                         title="Child: %d" % count)

        p = wx.Panel(self)
        wx.StaticText(p, -1, "This is child %d" % count, (10,10))
        p.SetBackgroundColour('light blue')

        sizer = wx.BoxSizer()
        sizer.Add(p, 1, wx.EXPAND)
        self.SetSizer(sizer)

        wx.CallAfter(self.Layout)


if __name__ == '__main__':
    app = wx.PySimpleApp(False)
    frame = ParentFrame(None)
    frame.Show()
    app.SetTopWindow(frame)
    app.MainLoop()

Run the above code, and you'll find an extra Menu "Window" in the menubar, but i didn't code it. i just don't know why's that happening. can anybody tell me?

By the way, it's a piece of wxPython code, you need have Pyhon and wxPython installed in your computer to run it
Sof_T
Can't get richer than this
Can't get richer than this
Posts: 864
Joined: Thu Jul 28, 2005 9:48 pm
Location: New Forest, United Kingdom
Contact:

Post by Sof_T »

You might get a better response in another section of the forum, this section is devoted to users of wxDev-C++ which is a windows based c++ IDE. Good Luck.
The home of Sof.T http://www.sof-t.site88.net/
Author of Programming with wxDevC++
http://sourceforge.net/projects/wxdevcpp-book/
lephon
Earned a small fee
Earned a small fee
Posts: 15
Joined: Tue Oct 28, 2008 3:20 am

Post by lephon »

Thank you, Sof_T.

I just try to find anyone who can help
Locked