473,378 Members | 1,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

closing a widget

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 here's the funny behaviour:

1) If I don't enter 2 quit works, if I do enter 2, I have to press the
"quit button" 2 times. Actually I have to press it an additional time
for every time I opened the window 2. What is happening? How can I
stop that???

2) For whatever reason I also have to click two times on the "destroy"
button at the end of the example. The destroy command is only executed
the second time I press the button ???!!!

All the widgest/windows are stand alone object and use their own
variables..
Jul 18 '05 #1
1 2145
in the meantime I found a work around, but "there is only one
mainloop" confuses ME ;)

When I generate a GUI with page, the function to open the window looks
like:

def vp_start_gui():
global w
global root
root = Tix.Tk()
root.title('xyz')
w = Klassenname (root)
init()
root.mainloop()

If I use for different windows different variables (like root1, root2
etc) and use commands like "root1.mainloop" and "root2.mainloop",
shouldn't I get one mainloop per window?

Regarding your questions:
I open the new windows rather independently in the same way as
described above.
I close windows based on a button pressed.
With quitting a windows I refer to the quit method.

Hope that clearifies it to a certain degree;)
"Michael Peuser" <mp*****@web.de> wrote in message news:<bh*************@news.t-online.com>...
"Marcus Schneider" <ms************@t-online.de> schrieb im Newsbeitrag
news:3f*************************@posting.google.co m...
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).


Do you mean you make (1) the basis of a Toplevel (2) ?
I close it.


(2) ? By a button created on that Toplevel ?
Each window has its own main loop.


There can only be one mainloop. No idea what happens, when you call mainloop
during in an event-routine. Never do it!
Now I want to open another window outside the mainloop of window 1.


What do you mean by this?
So
I quit that mainloop.


How can you do that? What at all do you mean by "mainloop"? Tkinter.mainloop
I presume?
go to


GOTO?
a new window, destroy that, enter the
mainloop of window 1 again and finally exit with destroy.

All this works in princial....


This is a surprises to me...
My be I really do not understand what you are doing.....

Kindly
Michael P.

[....]

Jul 18 '05 #2

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

Similar topics

2
by: Srinath Avadhanula | last post by:
Hello, Sorry to be bringing up what seems to be a somewhat beaten up topic... This is what I wanted to do: Create a _simple_ text editor widget which supports VI(M) style keybindings but...
2
by: Tonino | last post by:
Hi, I have a small Tkinter app that gets data from a socket connection to a "server". The app has a Text() widget to display the info that it gets from the socket connection. I have the...
6
by: William Gill | last post by:
I am trying to get & set the properties of a widget's parent widget. What I have works, but seems like a long way around the block. First I get the widget name using w.winfo_parent(), then i...
0
by: William Gill | last post by:
I have a Tkinter (frame) widget that contains several other frame widgets, each containing entry widgets. In the parent frame I have a 'save' button that is initially disabled. As it is now, each...
0
by: Tim N. van der Leeuw | last post by:
Hi, I need to display some hierarchical data, and because I don't want to force users to install too many things beyond Python itself, I'm hoping to use Tix which is at least included with...
2
by: Mudcat | last post by:
I am trying to change the width of a widget based on pixel size and not on characters. I can't figure out how to do this. Normally to change to the size of a widget it looks like: ...
2
by: Jacol | last post by:
Hi everybody, I have poblem with detecting closing of wx.Panel by user. How to detect that event? The wx.EVT_CLOSE event concerns wx.Frame class only. Neither Close() nor Destroy() aren't...
3
by: mariox19 | last post by:
Are Tkinter widgets running on their own thread? If I try to make a simple application that will print the letters A to Z to a Tkinter Text widget, and I space the printing of each letter by 1...
0
by: Phil Thompson | last post by:
On Sunday 04 May 2008, Lance Gamet wrote: I think QMainWindow.setCentralWidget() is what you are looking for. The eric4 IDE probably covers most things you'll ever need. Phil
3
by: drzoo2 | last post by:
Completely noob question as I am not a programmer but really trying hard to learn Python (Object oriented programming in general). I am writing a program in python that calls a popup window with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.