def __init__(self, parent, title, num=10000): """Set up a minimal relax GUI.""" # Store the args. self.num = num # Initialise the frame. wx.Frame.__init__(self, parent, title=title, size=(200, 100)) # Set up a pseudo-relax GUI. app = wx.GetApp() app.gui = self # Set up some standard interface-wide fonts. font.setup() # Initialise the special interpreter thread object. self.interpreter = Interpreter() # Build the controller, but don't show it. self.controller = Dummy_controller() # Open the muppy results file. self.file = open('muppy_log', 'w') # Run the test. self.test() print("Finished!") # Show the frame. self.Show(True)
def __init__(self, parent, title, num=10000): """Set up a minimal relax GUI.""" # Store the args. self.num = num # Initialise the frame. wx.Frame.__init__(self, parent, title=title, size=(200,100)) # Set up a pseudo-relax GUI. app = wx.GetApp() app.gui = self # Set up some standard interface-wide fonts. font.setup() # Initialise the special interpreter thread object. self.interpreter = Interpreter() # Build the controller, but don't show it. self.controller = Dummy_controller() # Open the muppy results file. self.file = open('muppy_log', 'w') # Run the test. self.test() print("Finished!") # Show the frame. self.Show(True)
def __init__(self, parent=None, id=-1, title=""): """Initialise the main relax GUI frame.""" # Store the wxPython info for os/machine/version specific hacks. status.wx_info = {} status.wx_info["version"] = wx.__version__.split('.') status.wx_info["minor"] = "%s.%s" % (status.wx_info["version"][0], status.wx_info["version"][1]) status.wx_info["os"] = sys.platform status.wx_info["build"] = None if search('gtk2', wx.version()): status.wx_info["build"] = 'gtk' elif search('cocoa', wx.version()): status.wx_info["build"] = 'cocoa' elif search('mac-unicode', wx.version()): status.wx_info["build"] = 'carbon' status.wx_info["full"] = None if status.wx_info["build"]: status.wx_info["full"] = "%s-%s" % (status.wx_info["os"], status.wx_info["build"]) # Some internal variables. self.test_suite_flag = False # The main window style. style = wx.DEFAULT_FRAME_STYLE if not status.debug and status.wx_info["os"] != 'darwin': style = style | wx.MAXIMIZE # Execute the base class __init__ method. super(Main, self).__init__(parent=parent, id=id, title=title, style=style) # Force the main window to start maximised (needed for MS Windows). if not status.debug and status.wx_info["os"] != 'darwin': self.Maximize() # Set up some standard interface-wide fonts. font.setup() # Set up the relax icons. relax_icons.setup() self.SetIcons(relax_icons) # Set up the Mac OS X task bar icon. #if status.wx_info["os"] == 'darwin' and status.wx_info["build"] != 'gtk': # self.taskbar_icon = Relax_task_bar_icon(self) # Initialise some variables for the GUI. self.launch_dir = getcwd() # Set up the frame. self.Layout() self.SetSize((self.min_width, self.min_height)) self.SetMinSize((self.min_width, self.min_height)) self.Centre() # The analysis window object storage. self.analysis = Analysis_controller(self) # The calculation threads list. self.calc_threads = [] # Initialise the GUI data. self.init_data() # Build the menu bar. self.menu = Menu(self) # Build the toolbar. self.build_toolbar() # Build the controller, but don't show it. self.controller = Controller(self) # Set the title. self.SetTitle("relax " + version) # Set up the status bar. self.status_bar = self.CreateStatusBar(3, 0) self.status_bar.SetStatusWidths([-4, -1, -2]) self.update_status_bar() # Add the start screen. self.add_start_screen() # Close Box event. self.Bind(wx.EVT_CLOSE, self.exit_gui) # Initialise the special interpreter thread object. self.interpreter = Interpreter() # Register functions with the observer objects. status.observers.pipe_alteration.register('status bar', self.update_status_bar, method_name='update_status_bar') status.observers.result_file.register('gui', self.show_results_viewer_no_warn, method_name='show_results_viewer_no_warn') status.observers.exec_lock.register('gui', self.enable, method_name='enab') # Assume a script has been run and there is data in the store. self.analysis.load_from_store()
# the Free Software Foundation, either version 3 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program. If not, see <http://www.gnu.org/licenses/>. # # # ############################################################################### # Python module imports. import wx # GUI module imports. from gui.analyses.auto_model_free import About_window from gui.fonts import font # Initialise the app. app = wx.App(0) # Set up the required fonts. font.setup() # Show the window. win = About_window(None) win.Show() app.MainLoop()
# GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program. If not, see <http://www.gnu.org/licenses/>. # # # ############################################################################### # Python module imports. import wx # GUI module imports. from gui.uf_objects import Uf_storage; uf_store = Uf_storage() from gui.fonts import font # Initialise the app. app = wx.App(0) app.gui = wx.Dialog(parent=None) # Set up the required fonts. font.setup() # The user function. uf = uf_store['sequence.read'] uf._sync = True uf.create_wizard(parent=app.gui) # Show the window. uf.wizard.Show() app.MainLoop()