473,666 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

want to wait until a popup dialog finishes

1 New Member
hi all,

I have a popup dialog using GTK, which allows user to select "Yes" or "No".
Then the program flows depending on the selected answer.
The problem is that func() doesn't not wait for Popup_Dlg()

How can I half the program flow and let it wait until Popup_Dlg() returns a value?
The code is run on Windows, Linux and Solaris


Thanks,
Shawn G

Expand|Select|Wrap|Line Numbers
  1. class A(,...,..)
  2.  
  3. def func(...)
  4.   answ = Popup_Dlg(self, ..,  )
  5.   if answ is True:
  6.     action 1
  7.   else:
  8.     action 2
  9.  
  10. class Popup_Dlg()
  11. ...
Aug 24 '07 #1
1 3090
bartonc
6,596 Recognized Expert Expert
hi all,

I have a popup dialog using GTK, which allows user to select "Yes" or "No".
Then the program flows depending on the selected answer.
The problem is that func() doesn't not wait for Popup_Dlg()

How can I half the program flow and let it wait until Popup_Dlg() returns a value?
The code is run on Windows, Linux and Solaris


Thanks,
Shawn G

Expand|Select|Wrap|Line Numbers
  1. class A(,...,..)
  2.  
  3. def func(...)
  4.   answ = Popup_Dlg(self, ..,  )
  5.   if answ is True:
  6.     action 1
  7.   else:
  8.     action 2
  9.  
  10. class Popup_Dlg()
  11. ...
Not sure about GTK, but in other frameworks (wxPython and Tkinter) it goes like this:
Create the dialog:
Expand|Select|Wrap|Line Numbers
  1. dlg = TheDialogClass(args)
Wait for the dialog to finish by calling its Modal() method:
Expand|Select|Wrap|Line Numbers
  1. answer = dlg.ShowModal()
Hope that helps.
Aug 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
13470
by: Kannan | last post by:
Hello, I have a requirement that specifies that I display a "Please Wait..." window (preferably modal) along with a gif that mimics a progress bar during a save operation. The dialog needs to be closed at the end of the operation. How do I go about this... Issues are: 1. I believe a showModaldialog would stop all back ground processing and shift control to the modal dialog. 2. I would like to close the dialog from the parent window...
0
2322
by: mrnicelife | last post by:
Hi, When using WebBrowser object to print an html page, the ExecWB call has a nice argument that allows an application to wait for the completion of the print job. When an app call ExecWB with the right argument, ExecWB method blocks until the page finishes spooling. If we pass the argument: PRINT_WAITFORCOMPLETION(0x02) on the third argument of ExecWB call, it will block the call until the spooling finishes. It is documented on:
14
5453
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net that works well as an html page. It brings up a modal popup window that I have been trying to work out for days now and this was the closest I have been able to come. I added a little asp.net code and an asp.net button and cannot get it to
4
17074
by: Peter | last post by:
I am using CreateProcessWithLogonW to run an external application, the problem I am having is that the C# program does not wait until the external program finishes running before continuing. The external program is a console application and it does not interact with users, how can I make my C# program wait until the program initiated by CreateProcessWithLogonW API completes running before continuing? here's my API code. bool ret =...
1
4566
by: VMI | last post by:
How can I add a small "Please wait..." form to a child form so that when I minimize the child form, the "Please Wait..." form will also disappear? This form will be displayed when the child form is running a lengthy process or when the child form is displayed. Once the child form finishes the process, or it's minimized, the "wait" form will also disappear. Thanks.
7
1970
by: multicherry | last post by:
Hi, Having searched for a way to fetch a window object by name, all I came across were answers along the line of... "All you have to do is say windowObj = window.open("blah", "name");" which isn't very useful if you want to fetch information from an existing document in the window. One solution I came up with was quite simple; open the "new" window, giving you a reference to the object, then use window.history.back() to
22
11744
by: Jason Zheng | last post by:
This may be a silly question but is possible for os.wait() to lose track of child processes? I'm running Python 2.4.4 on Linux kernel 2.6.20 (i686), gcc4.1.1, and glibc-2.5. Here's what happened in my situation. I first created a few child processes with Popen, then in a while(True) loop wait on any of the child process to exit, then restart a child process: import os from subprocess import Popen
2
3095
by: Doug | last post by:
Is there a way to get the VB code that opens a popup to wait until the popup is closed before continuing?
0
8445
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
8871
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
8781
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
8551
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
7386
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, and deployment—without 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...
0
4198
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...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
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
1776
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.