def open(): application = wxPySimpleApp() dialog = wxFileDialog(None, style=wxOPEN) if dialog.ShowModal() == wxID_OK: print "Selected:", dialog.GetPath() return str(dialog.GetPath()) # The user did not select anything else: print "Nothing was selected."
def save(text=None, suffix='*', filter='*'): application = wxPySimpleApp() if text == None: text = "Select a save file name" dialog = wxFileDialog(None, text, os.getcwd(), suffix, filter, wxSAVE) l = [] if dialog.ShowModal() == wxID_OK: for i in range(0, len(dialog.GetPaths())): l.append(str(dialog.GetPaths()[i])) print 'Selected:', l return l[0] else: print 'Nothing was choosen' dialog.Destroy()
def open(): application = wxPySimpleApp() dialog = wxFileDialog(None, "Select a file(s)", os.getcwd(), "*", "*", wxMULTIPLE) l = [] if dialog.ShowModal() == wxID_OK: dialog.Destroy() for i in range(0, len(dialog.GetPaths())): l.append(str(dialog.GetPaths()[i])) print 'Selected:', l return l else: print 'Nothing was selected.' dialog.Destroy()
def browse (self): try: import wxPython except ImportError: print 'wx not available' return from wxPython.wx import wxPySimpleApp import sys app = wxPySimpleApp() from wxtablebrowser import CasaTestFrame frame = CasaTestFrame(None, sys.stdout, self) frame.Show(True) app.MainLoop()
def browse(self): try: import wxPython except ImportError: print 'wx not available' return from wxPython.wx import wxPySimpleApp import sys app = wxPySimpleApp() from wxtablebrowser import CasaTestFrame frame = CasaTestFrame(None, sys.stdout, self) frame.Show(True) app.MainLoop()
def open(): application = wxPySimpleApp() #dialog = wxFileDialog ( None, style = wxOPEN ) dialog = wxFileDialog(None, "Select a file(s)", os.getcwd(), "*", "*", wxMULTIPLE) l = [] if dialog.ShowModal() == wxID_OK: #print 'Selected:', dialog.GetPaths() #return eval(str(dialog.GetPaths())) for i in range(0, len(dialog.GetPaths())): l.append(str(dialog.GetPaths()[i])) print 'Selected:', l return l # The user did not select anything else: print 'Nothing was selected.' # Destroy the dialog dialog.Destroy()
#! /usr/bin/env python # -*- coding: latin-1 -*- from wxPython.wx import wxPySimpleApp, wxFrame app = wxPySimpleApp() frame = wxFrame(None, -1, "Hello World") frame.Show(1) app.MainLoop()
InterpClass=None, *args, **kwds): wx.SplitterWindow.__init__(self, parent, id, pos, size, style, name) self.shell = py.shell.Shell(parent=self, introText=intro, locals=locals, InterpClass=Interpreter, *args, **kwds) self.editor = self.shell self.notebook = wx.Notebook(parent=self, id=-1) #self.filling = py.filling.Filling(parent=self.notebook, # rootObject=rootObject, # rootLabel=rootLabel, # rootIsNamespace=rootIsNamespace) # Add aksy vars self.shell.interp.introText = intro self.shell.interp.copyright = '' self.shell.interp.locals['z48'] = rootObject # Add programs, samples, multis in memory # self.notebook.AddPage(page=self.filling, text='Namespace', select=True) self.SplitHorizontally(self.shell, self.notebook, 300) self.SetMinimumPaneSize(1) if __name__ == '__main__': app = wxPySimpleApp() frame = Frame(None, "Aksy") root = Devices.get_instance('mock_z48') win = AksyShell( frame, intro=intro, rootLabel="Z48", rootIsNamespace=True, rootObject=root) app.MainLoop()