473,763 Members | 6,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what wrong with this program?

Ali
The following program is supposed to display a dropdown menu, however,
it only shows the File and Help things.

from Tkinter import *

root = Tk()

#create menu
m = Menu(root)
root.config(men u=m)

filemenu = Menu(m)
m.add_cascade(l abel="File", menu="filemenu" )
filemenu.add_co mmand(label="Ne w", command=callbac k)
filemenu.add_se parator()
filemenu.add_co mmand(label="Qu it", command=callbac k)

helpmenu = Menu(m)
m.add_cascade(l abel="Help", menu="helpmenu" )
helpmenu.add_co mmand(label="Ab out...", command=callbac k)

root.mainloop()

please help fix this program.
Jul 18 '05 #1
3 1627
Ali wrote:
The following program is supposed to display a dropdown menu, however,
it only shows the File and Help things.

from Tkinter import *

root = Tk()

#create menu
m = Menu(root)
root.config(men u=m)

filemenu = Menu(m)
m.add_cascade(l abel="File", menu="filemenu" )


The menu= argument needs to be the object itself, not a string.

See, e.g.

http://www.pythonware.com/library/tk...9-patterns.htm

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Jul 18 '05 #2
Ali
Robert Kern <rk***@ucsd.edu > wrote in message news:<cf******* ***@news1.ucsd. edu>...
Ali wrote:
The following program is supposed to display a dropdown menu, however,
it only shows the File and Help things.

from Tkinter import *

root = Tk()

#create menu
m = Menu(root)
root.config(men u=m)

filemenu = Menu(m)
m.add_cascade(l abel="File", menu="filemenu" )


The menu= argument needs to be the object itself, not a string.

See, e.g.

http://www.pythonware.com/library/tk...9-patterns.htm


ok I will try it out. Thanks for your help
Jul 18 '05 #3
Ali
Robert Kern <rk***@ucsd.edu > wrote in message news:<cf******* ***@news1.ucsd. edu>...
Ali wrote:
The following program is supposed to display a dropdown menu, however,
it only shows the File and Help things.

from Tkinter import *

root = Tk()

#create menu
m = Menu(root)
root.config(men u=m)

filemenu = Menu(m)
m.add_cascade(l abel="File", menu="filemenu" )


The menu= argument needs to be the object itself, not a string.

See, e.g.

http://www.pythonware.com/library/tk...9-patterns.htm


ok I will try it out. Thanks for your help
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

137
7172
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very pragmatic - 3) I usually move forward when I get the gut feeling I am correct - 4) Most likely because of 1), I usually do not manage to fully explain 3) when it comes true. - 5) I have developed for many years (>18) in many different environments,...
125
14835
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
5
2835
by: titan0111 | last post by:
#include<iostream> #include<iomanip> #include<cstring> #include<fstream> using namespace std; class snowfall { private: int ft;
1
2144
by: Qiangning Hong | last post by:
I decide to seperate my data collection routine from my data analysis and storage program to a seperate process, so I try to use the new subprocess model in Python 2.4. The main program spawns the subprocess and receives data from the pipe. When some event occurs (e.g. the user clicks the 'Stop' button on GUI), the main program will send the subprocess a command to change its behavior or ask it to exit. However, my code (attached...
46
4247
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do believe MSFT should do to improve C#, however. I know that in the "Whidbey" release of VS.NET currently
669
26182
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
3
2748
by: belton180 | last post by:
CODE]../* Program function: Simulate the stack using a stack limit of 10. Display a menu for the the following. Create a stack Insert an item in the stack Pop an item from the stack Peep/view the item at the top of the stack Current value of top View all items stored in the stack Quit *the stack accepts lowercase & uppercase characters only from A-Z
20
2818
by: Daniel.C | last post by:
Hello. I just copied this code from my book with no modification : #include <stdio.h> /* count characters in input; 1st version */ main() { long nc; nc = 0;
12
2111
by: broli | last post by:
#include<stdio.h> #include<stdlib.h> struct point { double x, y, z;
4
1965
by: hirsh.dan | last post by:
i have a functions that writes information to a file. inside that function i have a line in which i call another function. if this line is executed, nothing is written to the file, but if i remark that line, it is written. i wanna understand what's wrong and fix it, but can't find what is wrong. also this line is mandatory in my code. the code attached is in the link, minimized to the needed info, a bit different then the way it's...
0
9564
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.