473,386 Members | 1,647 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,386 software developers and data experts.

winfo_exists

I want to know, whether a window is already open or not. Following a
peace of the code.
-----
....
class Auswahlmenue:
def __init__(AM):

AM.Fenster = Toplevel()
...
AM.Fenster.destroy(); Startsortierung()
#-------------------------
class Startsortierung:
def __init__(SS):
#-------------------------
def Abbruch(xxx):
SS.Fenster_2.destroy()
#!! Abfragen, ob bereits ein Auswahlmenü geöffnet ist!
if not Auswahlmenue.Fenster.winfo_exists():
Auswahlmenue()
#-------------------------
def Auswahl(xxx):
Auswahlmenue()
#-------------------------
def weiter(xxx):
SS.Fenster_2.destroy()
#-------------------------
SS.Fenster_2 = Toplevel()
Label(SS.Fenster_2, text= u'... ...').pack()
SF = Button(SS.Fenster_2, text= u'abbrechen', underline= 0)
SF.pack(side= u'left')
SS.Fenster_2.bind(sequence= '<KeyPress-a>', func= Abbruch)
SF = Button(SS.Fenster_2, text= u'Auswahlmenü', underline= 0)
SF.pack(side= u'left')
SS.Fenster_2.bind(sequence= '<KeyPress-A>', func= Auswahl)
SF = Button(SS.Fenster_2, text= u'weiter', underline= 0)
SF.pack(side= u'right')
SS.Fenster_2.bind(sequence= '<KeyPress-w>', func= weiter)
TkFenster.wait_window(SS.Fenster_2)
----
The main programm calls the class Auswahlmenue. In this class the user
can choose Startsortierung. In this class the user may (after a
prozess) go back to Auswahlmenue without destroying the
Startsortierung-window (SS.Fenster_2), because he needs the information
shown there. Or he may go back immeaditely to Auswahlmenue via Abbruch
(destroying SS.Fenster_2 and opening AM.Fenster). In the first way the
user later will close the SS.Fenster_2-window - but how do I get the
information, the AM.Fenster is already open or not? I do not want have
two AM.Fenster open.
I hoped toget this via winfo_exists, but there´s a mistake in the
if-row.
Indeed I could do it with a global flag, but is there a possibility to
do it with winfo_exists()?

Thanks for help
Dada

Feb 13 '06 #1
0 803

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

Similar topics

6
by: max(01)* | last post by:
hi people. when i create a widget, such as a toplevel window, and then i destroy it, how can i test that it has been destroyed? the problem is that even after it has been destroyed, the instance...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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...
0
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,...
0
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...

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.