I want to display (and update) the real time within a button in a modal dialog. Is this possible? I tried the following script, but it didn't work. It displays the real time initially, but the time doesn't update.
gettime>time
dialog>timerdialog
left=300
top=300
width=300
height=300
button=time,20,20,90,25,3
enddialog>timerdialog
label>mainloop
show>timerdialog,result
if>result=3,end
gettime>time
resetdialogaction>timerdialog
goto>mainloop
label>end
Thanks for your help,
Kwhiz
Can you display and update real time within a button?
Moderators: JRL, Dorian (MJT support)
I don't think you want to do this with a modal dialog. Here is an example with a non-modal dialog. Click the button to close.
GetTime>ttime
Dialog>MyDialog
Caption= Time
Width=100
Height=80
Top=CENTER
Left=CENTER
Max=0
Min=0
Close=0
Resize=0
Button=ttime,27,16,75,25,2
EndDialog>MyDialog
Show>MyDialog
Label>start
GetDialogAction>MyDialog,r
If>r=2,End
GetTime>ttime
Let>MyDialog.MSBUTTON0=%ttime%
ResetDialogAction>MyDialog
Wait>0.01
Goto>start
Label>End
Hope this is helpful,
Dick
GetTime>ttime
Dialog>MyDialog
Caption= Time
Width=100
Height=80
Top=CENTER
Left=CENTER
Max=0
Min=0
Close=0
Resize=0
Button=ttime,27,16,75,25,2
EndDialog>MyDialog
Show>MyDialog
Label>start
GetDialogAction>MyDialog,r
If>r=2,End
GetTime>ttime
Let>MyDialog.MSBUTTON0=%ttime%
ResetDialogAction>MyDialog
Wait>0.01
Goto>start
Label>End
Hope this is helpful,
Dick
Thanks for your reply, but if possible I would like to put the real time into a MODAL dialog. I already have a large modal dialog set up which stays open throughout the day and constantly waits for input. I would like to insert the current time into the modal dialog, give or take a minute (it doesn't have to be the exact time).
Your non-modal dialog was interesting, but not really helpful in my situation. Sorry and thank you.
The original question remains. Does anyone know how to keep the current time updated within a modal dialog? Any ideas would be very helpful and much appreciated. Thank you!
KWhiz
Your non-modal dialog was interesting, but not really helpful in my situation. Sorry and thank you.
The original question remains. Does anyone know how to keep the current time updated within a modal dialog? Any ideas would be very helpful and much appreciated. Thank you!
KWhiz
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
It would be impossible to update the time on a modal dialog, because ... well, because the dialog is modal! Modal means NOTHING happens until the user dismisses it. Everything gets held up until the dialog is dismissed. So how could it be updated with the current time if it is modal? It can't. Impossible.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
.
Oh yes, thank you for responding, I think I understand better now. For those of you who understand the old BASIC computer programming language (my only computer programming experience, and that was from 20 years ago), I was confusing the word "modal" to be the equivalent of the BASIC command, "input."
In other words, I was thinking that non-modal dialogs didn't have input (ie, buttons, etc). But of course non-modal dialogs have input! Sorry for the confusion, but I think I understand better now. I've spent a little time today reading and studying the Help files to obtain better clarity on the subject, and I believe I undertand it now. So off I go now to create a new non-modal dialog!
Thanks alot for everyone's help,
Kwhiz
Oh yes, thank you for responding, I think I understand better now. For those of you who understand the old BASIC computer programming language (my only computer programming experience, and that was from 20 years ago), I was confusing the word "modal" to be the equivalent of the BASIC command, "input."
In other words, I was thinking that non-modal dialogs didn't have input (ie, buttons, etc). But of course non-modal dialogs have input! Sorry for the confusion, but I think I understand better now. I've spent a little time today reading and studying the Help files to obtain better clarity on the subject, and I believe I undertand it now. So off I go now to create a new non-modal dialog!
Thanks alot for everyone's help,
Kwhiz