From 71d956e5fa221841561c12bbc2845ebfa3f80099 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Sat, 18 Aug 2012 10:07:58 +0200 Subject: [PATCH] Creates Filemenu. --- ivolution/gui/IvolutionWindow.py | 5 +---- ivolution/gui_wx/IvolutionWindow.py | 34 +++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ivolution/gui/IvolutionWindow.py b/ivolution/gui/IvolutionWindow.py index e851232..03bd593 100755 --- a/ivolution/gui/IvolutionWindow.py +++ b/ivolution/gui/IvolutionWindow.py @@ -16,15 +16,12 @@ from .. import get_data # parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # os.sys.path.insert(0,parentdir) # import parent folder -from .. import Facemovie_lib from .. import FaceParams from .. import FacemovieThread -from ..util.Notifier import Observer +from ..util.Notifier import Observer from ..util.Notifier import Observable -import time - class IvolutionWindow(Observer, Observable): def __init__(self, name): FacemovieThread.Observer.__init__(self, name) diff --git a/ivolution/gui_wx/IvolutionWindow.py b/ivolution/gui_wx/IvolutionWindow.py index 0bad812..30e8a87 100644 --- a/ivolution/gui_wx/IvolutionWindow.py +++ b/ivolution/gui_wx/IvolutionWindow.py @@ -10,7 +10,33 @@ import wx -app = wx.App(False) # Create a new app, don't redirect stdout/stderr to a window. -frame = wx.Frame(None, wx.ID_ANY, "Hello World") # A Frame is a top-level window. -frame.Show(True) # Show the frame. -app.MainLoop() \ No newline at end of file + +class IvolutionWindow(wx.Frame): + """ + Main Window of the application + """ + def __init__(self, parent, title): + """ + Overrides init frame wx.Frame + """ + wx.Frame.__init__(self, parent, title=title, size=(200, 100)) + self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE) + self.CreateStatusBar() # A Statusbar in the bottom of the window + + # Setting up the menu. + filemenu = wx.Menu() + + # wx.ID_ABOUT and wx.ID_EXIT are standard IDs provided by wxWidgets. + filemenu.Append(wx.ID_ABOUT, "&About", " Information about this program") + filemenu.AppendSeparator() + filemenu.Append(wx.ID_EXIT, "E&xit", " Terminate the program") + + # Creating the menubar. + menuBar = wx.MenuBar() + menuBar.Append(filemenu, "&File") # Adding the "filemenu" to the MenuBar + self.SetMenuBar(menuBar) # Adding the MenuBar to the Frame content. + self.Show(True) + +app = wx.App(False) +frame = IvolutionWindow(None, "Ivolution Window") +app.MainLoop() # Runs application