473,609 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Closing Toplevel windows

I'm trying to determine best practices as well as learn basic coding
syntax. I wish to open an input screen to view/enter data. The screen
also requires a menu. This is part of the code I have so far:

import Tkinter
import tkMessageBox
import Pmw
import wcgc_pg

class calendarWindow:
def __init__(self, parent):
megaToplevel = Pmw.MegaTopleve l(parent, title = 'Calendar Program')
toplevel = megaToplevel.in terior()
self.balloon = Pmw.Balloon(top level)

menuBar = Pmw.MainMenuBar (toplevel,
balloon = self.balloon)
toplevel.config ure(menu = menuBar)
self.menuBar = menuBar
...

This is basically code taken from the Pmw demos. What I wish to
determine now is how to close this window from a menu option and/or a
button. Neither withdraw() nor deactivate() work.

Thanks...
--
---------------------------------------------------------------------
Scott Holmes http://sholmes.ws
http://pages.sbcglobal.net/scottholmes
sc*********@sbc global.net

Independent Programmer/Analyst Passport 4GL
PHP HTML Composer PostgreSQL Informix 4GL, SQL
---------------------------------------------------------------------
There are more things in heaven and earth, Horatio,
than are dreamt of in your philosophy
---------------------------------------------------------------------
Jul 18 '05 #1
0 1309

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

Similar topics

1
2151
by: Marcus Schneider | last post by:
Normally I close my windows/widgets with destroy and it works fine. Now I have a window (let's call it 1) from where I open an additional window (let's call it 2). I close it. Each window has its own main loop. Now I want to open another window outside the mainloop of window 1. So I quit that mainloop, go to a new window, destroy that, enter the mainloop of window 1 again and finally exit with destroy. All this works in princial, but...
3
17770
by: Svennglenn | last post by:
Hi I'm creating a program in Tkinter and I would need help to create a "close button" for dialog windows. One of my typical dialog windows look like this: def show_window(self): top = Toplevel()
5
2251
by: Ron L | last post by:
I have an MDI application with a number of child windows. In each child window I am catching the Closing event and having the child window decide if it should set cancel to true. The intent here is to ensure that no child window can close while it is in a state where user entered information can be lost. I have just noticed that while the Closing event is caught if I click the X on the child window, it is not caught if I click the X on...
6
5656
by: Al the programmer | last post by:
I want to catch the Closing event for my form. I created a test windows app using the wizard. I then create the Closing event by clicking the lightning bolt on the properties pane. The code is added to the app but my app won't compile. It generates a "Test.Form1.Closing() denotes a 'method' which is not valid in the given context" error.
1
13197
by: Uchiha Jax | last post by:
Standard Framework documentation goes into great detail " A top-level form is a window that has no parent form, or whose parent form is the desktop window. Top-level windows are typically used as the main form in an application." So why is it that standard windows events fail to work in textboxes with ..TopLevel = false forms? ////(inside the load event of a form)
2
1358
by: Tuomas | last post by:
From a PyGTK component I would like to react moving and resizing the toplevel window. I try to connect the toplevel 'frame-event' to my callback, but the toplevel do not fire on moving or resizing. Any suggestions? Tuomas (Linux, Python 2.3, GTK 2.6.7)
7
6576
by: Chris | last post by:
Hi, If a user resizes a Toplevel window, or I set a Toplevel's geometry using the geometry() method*, is there any way to have the geometry reset to that required for all the widgets? I think I found what I'm looking for in tk itself: """ 13.3. How can I clear the geometry settings for a toplevel? If you want to have Tk resize your toplevel to what the toplevel
2
5517
by: Pedro | last post by:
Hi I'm trying to build a small application that can display some images in a toplevel window. I have this code: def Results(master): from Tkinter import Toplevel, Button, Label from PIL import ImageTk figures =
4
2210
Fr33dan
by: Fr33dan | last post by:
Hi, I'm having trouble with a multi-threaded program crashing on a specific machine when the worker thread is not initialized at when the _FormClosing method of my main form called. Here is my on _FormClosing method: private void CycleBox_FormClosing(object sender, FormClosingEventArgs e) { // Set the boolean flags to stop cycling in worker thread. // Closing prevent dialogs from opening
0
8115
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8053
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8513
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8205
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8380
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...
1
6047
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
5504
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1638
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1374
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.