wxPython Default Widgets - Please Help

David Oppenheimer davidopp at megsinet.net
Fri Sep 24 01:11:35 EDT 1999


Dear Group,

Still trying to get some help here.  What I want to do is to have code
which will provide a listing of the defaults for the following wxPython
widgets: Button, Canvas, Checkbutton, Entry, Frame, Label, Listbox,
#Menu, Menubutton, Message, Radiobutton, Scale, & Scrollbar.

I need these to be able to have wxPython as an output choice in a drag
and drop GUI maker I am collaborating on.  So please help, or the only
output choice for this software will be Tkinter.  I am not going to
beg.  If I get no responses to this posting then Tkinter it is.  That
would be sad cause I had really hoped for a multi widget programming
aide.

The Tkinter code (that I require the equivalent of in wxPython) is as
follows:


from Tkinter import *

def write_defaults(Widget):
        widget = Widget()
        widget.place(x=0, y=0)
        filename = "%s.txt" % Widget.__name__
        file = open(filename, "w")
        for key in widget.keys():
                if widget[key] == "":
                        widget[key] = None
                        print widget[key]
                file.write("%s = %s\n" % (key, widget[key]) )
        file.close()



if __name__ == "__main__":
        root = Tk()
        widgets = [ Button,
                        Canvas,
                        Checkbutton,
                        Entry,
                        Frame,
                        Label,
                        Listbox,
                        #Menu,
                        Menubutton,
                        Message,
                        Radiobutton,
                        Scale,
                        Scrollbar]
        for widget in widgets:
                write_defaults(widget)
        root.mainloop()



Thanks,

David Oppenheimer





More information about the Python-list mailing list