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

How do I prevent master window from being accessed with child window present?

Hi,

I am doing a gui application where child windows pop up with options
after the user selects particular buttons from the master window.
However, the master window is still active underneath the child
window. If they accidentally press the same button again they can get
the same copy of two child windows, and that screws up a bunch of the
database stuff that I am trying to collect.

I have tried using the 'transient' method, and that prevents the
master window from being highlighted. But the user can still push
buttons on the master window if the child window is moved aside.

How do I disable the master window until the child window is closed?

Thanks,
Marc
Jul 18 '05 #1
4 7889
On Fri, 2003-08-29 at 11:12, Marc wrote:
Hi,

I am doing a gui application where child windows pop up with options
after the user selects particular buttons from the master window.
However, the master window is still active underneath the child
window. If they accidentally press the same button again they can get
the same copy of two child windows, and that screws up a bunch of the
database stuff that I am trying to collect.

I have tried using the 'transient' method, and that prevents the
master window from being highlighted. But the user can still push
buttons on the master window if the child window is moved aside.

How do I disable the master window until the child window is closed?


And which GUI toolkit are you using? Most have an option to open a
window as "modal" (although this might be limited to dialogs for your
particular toolkit) which means it retains the focus exclusively until
it's dismissed.

--
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 (800) 735-0555
Jul 18 '05 #2
I guess knowing which kit would help. I am using Tkinter.
"Cliff Wells" <lo******@qwest.net> wrote in message
news:ma**********************************@python.o rg...
On Fri, 2003-08-29 at 11:12, Marc wrote:
Hi,

I am doing a gui application where child windows pop up with options
after the user selects particular buttons from the master window.
However, the master window is still active underneath the child
window. If they accidentally press the same button again they can get
the same copy of two child windows, and that screws up a bunch of the
database stuff that I am trying to collect.

I have tried using the 'transient' method, and that prevents the
master window from being highlighted. But the user can still push
buttons on the master window if the child window is moved aside.

How do I disable the master window until the child window is closed?


And which GUI toolkit are you using? Most have an option to open a
window as "modal" (although this might be limited to dialogs for your
particular toolkit) which means it retains the focus exclusively until
it's dismissed.

--
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 (800) 735-0555

Jul 18 '05 #3

"Marc" <lo********@comcast.net> schrieb im Newsbeitrag
news:7Y********************@comcast.com...
I guess knowing which kit would help. I am using Tkinter.

Of course you were usind Tkinter...

(1) You can use the modal approach (have a look how Pmw are doing this.
(2) Disable all your controls in the main widget when you show the child
window.
(3) "withdraw" the main window (this is not iconify!)

Example:
from Tkinter import *

m=Tk()
m.title("Parent")
c=Toplevel(m)
c.title("Child")
Button(c,text="Hello",command=c.destroy).pack()

c.bind("<Destroy>",lambda x:m.deiconify())
# note we need lambda to get rid of the Destroy argument
#we should "bind", because there are many ways a window can be killed

m.withdraw()

mainloop()

Jul 18 '05 #4
Marc wrote:
Hi,

I am doing a gui application where child windows pop up with options
after the user selects particular buttons from the master window.
However, the master window is still active underneath the child
window. If they accidentally press the same button again they can get
the same copy of two child windows, and that screws up a bunch of the
database stuff that I am trying to collect.

I have tried using the 'transient' method, and that prevents the
master window from being highlighted. But the user can still push
buttons on the master window if the child window is moved aside.

How do I disable the master window until the child window is closed?


childWindow.grab_set()

HTH
--
- Eric Brunel <er*********@pragmadev.com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com

Jul 18 '05 #5

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

Similar topics

5
by: Daniel | last post by:
Does anyone know how this can be done? Thanks
3
by: Mark C | last post by:
I have a unbound form with a tab control with four tabs in an Access 97 database. On each tab I have a sub form each form on the sub forms is bound to its own table. Each table has a field that can...
6
by: John Bowman | last post by:
Hi All, I must be missing something really obvious, so I'd appreciate someone helping me out. I have a simple Windows form that currently only has a title bar (aka the Text Property is set) and...
7
by: MrFez | last post by:
Through some investigation it appears that selecting "Every visit to the page" for the IE caching setting "Check for new version of stored pages" causes the window.opener property of child windows...
7
by: Martijn Saly | last post by:
Hi there, I've created a master page with some controls on it, a Calendar control among others. Now depending on the date(s) selected, the content page needs to be updated. In the masterpage...
5
by: André | last post by:
Hi, I am using this code to prevent multi click asp.net 2.0 c#, System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("SetValue();"); sb.Append("if...
0
by: Mike Wilson | last post by:
Dear group, I have an invoice entry form, which is a simple Master fields / Detail grid. The main summary information of the invoice are stored in one table in a dataset, which is bound using a...
4
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase...
1
Frinavale
by: Frinavale | last post by:
I'm having a problem that I cannot seem to debug. FireFox's FireBug extension is indicating that there is an error being thrown, but I have no idea which window caused the error to be thrown. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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...
0
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...
0
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...
0
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 project—planning, coding, testing,...
0
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...

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.