Help - GUI programming question

Tim Roberts timr at probo.com
Fri Sep 27 07:16:03 CEST 2002


 wrote:

>Quick question. The following yields the error: "makemenu takes only one
>argument (2 given)". This should be simple - I'm just not seeing it! Can
>anyone explain? The applicable code follows:

I know!  I know!  What's the prize?

>class WINMENU:
>  def makemenu(parent):

Your makemenu DOES only expect one argument.  You need to make room for the
instance:

   def makemenu(self,parent):

>    menubar = Frame(parent)                        # win=top-level window
>    menubar.pack(side=TOP, fill=x)                 # set its menu option
>	(more code to build a menu.....)
>
>if __name__ == '__main__':
>  root = Tk()
>  root.title('GUI Menu')
>  smenu = WINMENU()
>  smenu.makemenu(root)  
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list