Unable to even use it

Help
Anonymous
2012-12-21
2013-02-21

  • Anonymous
    2012-12-21

    After finally figuring out how to install,  i cannot even use it, i can create Tkinter widgets juuust fine but

    Traceback (most recent call last):
      File "<pyshell#5>", line 22, in <module>
        root = pmw.initialize()
    AttributeError: 'module' object has no attribute 'initialize'

    using python 2.6.6 and pmw 1.3, whats wrong here?i tried initialize and initailise. Neither workz

     
  • Adrian
    Adrian
    2013-02-06

    Sorry for the late reply but these forums haven't been accessed in such a long time that I completely forgot to check them out :)

    I recommend using Pmw version 1.3.2 or the version I've tried bringing to date with the latest changes in python 2 - 1.3.3. An example program would look like this:

    import Pmw
    import Tkinter
    root = Tkinter.Tk()
    Pmw.initialise(root)
    root.mainloop()
    

    this should bring up an empty window. In order to add to the window you'd call the necessary constructor - such as Pmw.OptionMenu - and then call the pack method of the object returned by the constructor.

    import Pmw
    import Tkinter
    root = Tkinter.Tk()
    Pmw.initialise(root)
    menu = Pmw.OptionMenu(root)
    menu.pack()
    root.mainloop()