Esempio n. 1
0
def PMW_test():  #http://download.sourceforge.net/pmw
    '''parts stolen from Tkinter list
    '''
    import Tkinter as Tk
    import Pmw
    import rClickclass as rC

    root = Tk.Tk()
    root.title('Tool')
    Pmw.initialise(root)
    
    Mainframe = Tk.Frame(root, width=215, height=210)
    class AtsMenuBar:
        def __init__(self):
            menuBar=Pmw.MenuBar(Mainframe, hull_relief='raised', hull_borderwidth=1)
            menuBar.pack(fill='x')
        
            sc2 = Pmw.ScrolledFrame(Mainframe)  #
            sc2.pack(fill='x', expand=1, padx=2, pady=2)
            sc2.place(relx=0.25, rely=0.25, anchor='nw')
            HashBox1 = Pmw.EntryField(sc2.interior(), labelpos='w', labelmargin=1,
         validate = None)
        
            HashBox1.pack(fill='x', expand=1, padx=1, pady=1)
            
                
    menu = AtsMenuBar()
    Mainframe.pack(fill = 'both', expand = 1, padx = 5, pady = 5)
    Mainframe.pack_propagate(0)
    
    u = rC.rClick(root, "PMW_test")
    root.mainloop()
Esempio n. 2
0
def Tk_test():
    ''' from the help
    '''
    import Tkinter as Tk
    import rClickclass as rC
    class App(Tk.Frame):
        def __init__(self, master=None):
            Tk.Frame.__init__(self, master)
            self.pack()
            self.entrythingy = Tk.Entry().pack()
            self.Listthingy = Tk.Listbox(name= 'lbb').pack()

    myapp = App()
    
    myapp.master.title("_test App")
    
    u = rC.rClick(myapp, "Tk_test")
    myapp.mainloop()
Esempio n. 3
0
def anygui_test(g= 'tkgui' ):
    '''http://anygui.sourceforge.net
    In [1]: from anygui import *
    In [2]: backend()
    Out[2]: 'msw'
    PythonWin  (mswgui)    {http://starship.python.net/crew/mhammond/win32}
    Tkinter    (tkgui)     {http://www.python.org/topics/tkinter}
    wxPython   (wxgui)     {http://www.wxpython.org}
    Java Swing (javagui)   {http://www.jython.org}
    PyGTK      (gtkgui)    {http://www.daa.com.au/~james/pygtk}
    Bethon     (beosgui)   {http://www.bebits.com/app/1564}
    PyQt       (qtgui)     {http://www.thekompany.com/projects/pykde}
    Curses     (cursesgui) -- used when no GUI package is available
    Plain text (textgui)   -- used if curses is not available
    'msw gtk java wx tk beos qt curses text'
: On some platforms, including FreeBSD and Mac OS X, setting environ may cause memory leaks. Refer to the system documentation for putenv
    {http://www.anygui.org}, subscribe to the developer's mailing list ([email protected]) and the user's list ([email protected]), and try to familiarise yourself with how the package works behind the scenes. 
        '''
    import os
    os.environ['ANYGUI_WISHLIST'] = 'tk wx * text curses' 

    #import anygui.backends.tkgui as gui
    import anygui as gui
    import rClickclass as rC

    app = gui.Application()

    btn = gui.Button(text= 'Hello' )
    lbx = gui.ListBox()
    lbx.items = 'first second third'.split() 
    TextA = gui.TextArea()

    win = gui.Window(size= (200,100) )
    win.add(btn, left= 0, top= 0, right= 0, bottom= 0, hstretch= 1, vstretch= 0 )
    win.add(lbx, hstretch= 1, vstretch= 0 )
    win.add(TextA, hstretch= 1, vstretch= 0 )

    app.add(win)

    u = rC.rClick(app._root, "anygui_test")
    app.run()
Esempio n. 4
0
   
#    sys.stderr.write("Exception in Tkinter callback\n")
    sys.last_type = exc
    sys.last_value = val
    sys.last_traceback = tb
    traceback.print_exception(exc, val, tb, file=builder)
    e = ExceptionBox(self, "Exception", builder.getvalue())

if __name__ == '__main__':
    # Import Psyco if available
    try:
        import psyco
        psyco.full()
    except ImportError:
        pass

    Tk.report_callback_exception = report_callback_exception
    root = Tk()
    app = App(root)
    if hasattr(sys, 'frozen'):
        if getattr(sys, 'frozen', None) in ('macosx_app',):
            root.tk.call('console', 'hide')
    
    u = rC.rClick(root, '------')
    root.mainloop()

#    except:
#        builder = cStringIO.StringIO()
       
#        traceback.print_exc(file=builder)
#        e = ExceptionBox(root, "Exception", builder.getvalue())