Hello all,
Actually i need to close a dialog automatically after 5-6 seconds.
For it what should i do,please help me.I am using wxTimer
[code]
self.MB = wx.Dialog(self,-1,"hello",pos =(-1,-1),size=(200,10 0),style=wx.NO_ 3D)
self.MB.Show(Tr ue)
self.timer = wx.Timer(5,self .Step(self))
self.timer.Star t()
def Step:
if self.timer.IsRu nning():
print ""
else:
self.MB.Close(T rue)
[code]
Is this code is not correct or what?
Please help me.
1 1689 -
self.MB = wx.Dialog(self,-1,"hello",pos=(-1,-1),size=(200,100),style=wx.NO_3D)
-
self.MB.Show(True)
-
self.timer = wx.Timer(5,self.Step(self))
-
self.timer.Start()
-
-
-
def Step:
-
if self.timer.IsRunning():
-
print ""
-
else:
-
self.MB.Close(True)
-
Is this code is not correct or what?
Please help me.
No this code is not correct. -
self.MB = wx.Dialog(self,-1,"hello",pos=(-1,-1),size=(200,100),style=wx.NO_3D)
-
self.MB.Show(True)
-
# wrong initialization of timer
-
self.timer = wx.Timer(self.Step())
-
## self.timer = wx.Timer(5,self.Step(self))
-
# Start needs the time in milliseconds
-
self.timer.Start(5000)
-
## self.timer.Start()
-
-
# Function declaration needs () argument list
-
def Step(self):
-
if self.timer.IsRunning():
-
print ""
-
else:
-
self.MB.Close(True)
-
Also, I hope that your formatting is correct and you simply lost it because you didn't use code tags...
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Austin |
last post by:
I wrote a GUI program on windows. (python & wxPython)
One function is to refresh the data from the COM Object continously.
In the beginning, I used the thread.start_new_thread(xxx,())
But no matter how i try, it will cause the win32com error.
After that, i use the wx.Timer to do the refresh function.
It works fine, but i find one problem.
I think timer should be independant, just like thread, but wxTimer doesn't.
1. Does python have...
|
by: Jonan |
last post by:
Hi,
I use JavaScript
I have tree windows.
Jonan1.html has this code erref1=window.open("Jonan2.html", "mypage",null);
This opens Jonan2.html and it has this code
erref=window.showModalDialog("Dialogo.html", null);
This opens Dialogo.html
How can I do to close Jonan2.html and Dialogo.html from Jonan1.html
How can I get the Dialogo.html reference from Jonan1.html.
|
by: chon |
last post by:
I have an ASP page that is sent a file location as a parameter. It opens
this file, loads the ADODB.Stream object and does a binary write to the page
forcing the download dialog to appear. This all works fine. If the user
selects "Open" or "Cancel", the window closes, which is the desired behavior.
If they select "Save", the location dialog shows up, they save the file and
the window remains open. I've tried a number of things to get...
|
by: nsr93 |
last post by:
I am not sure if this was the proper group to post this, but here is
my question:
I am a Java consultant. I have new client I am working for to make a
web based application similar to an ecommerce site. We aren't selling
anything but we have a notion of a cart where you add schedule items.
You can perform actions such as add/edit/remove schedule items to a
schedule. This is an over simplifcation but you get the idea.
I am not a...
|
by: James Fortune |
last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't
understand why people who know how to write code to completely replace
a front end do not write something that will automate the code that
implements managing unbound controls on forms given the superior
performance of unbound controls in a client/server environment. I can
easily understand a newbie using bound controls or someone with a
tight deadline. I guess I need...
| |
by: Mark Kamoski |
last post by:
Hi--
Please help.
I need a code sample for bubble sort.
Thank you.
--Mark
|
by: stephen |
last post by:
I have created an order form that users javascript to create a new html
document when the customers clicks the "print page" button.
Once the new document has been created it then prints the document and
closes it with the following code:
<body onload="window.print(); window.close();">
This works correctly (or at least the way I expect it to work under MS
Internet Explorer, but it cuases Netscape to "crash"
|
by: georges the man |
last post by:
hey guys,
i ve been posting for the last week trying to understand some stuff about c and reading but unfortunaly i couldnt do this.
i have to write the following code. this will be the last time i ask for an entire code or u can give me the outine of what to do and i ll do it by myself.
the description is the following:
the program will read a text file that contains historical price of a stock. The program will allow users to query...
|
by: Sin Jeong-hun |
last post by:
I have a dialog form which pops up from the main window using the
ShowDialog() method. this dialog has no or button, and
it has quite a lot of controls on it. Now, I want to close this dialog
form when the user presses the escape key, but that's only when no
control on the form is responsible for the escape key. For example, it
has a ComboBox control, and a user can press the escape key just to
close the drop down list that is being...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |