AutoHotkey Community

It is currently May 27th, 2012, 4:16 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: February 20th, 2010, 3:48 am 
Hello,

I have wrote a gui that I plan on having do some things with clocks and timers. Once I hit a button, a time is put into a text field. How can I have a loop that is ALWAYS executing while the gui is alive that could say, decrement a second (I don't need help with decrementing a second, only the placement of said loop). I tried placing after the full code of the gui and nothing happened. Any help would be much appreciated.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 4:21 am 
Offline

Joined: July 6th, 2009, 9:58 pm
Posts: 678
Code:
#Persistant
Loop
{
IfWinExist, Wintitle Of Your GUI
msgbox
}


not complete but might point you in the right direction for the help file


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 4:43 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
I think of GUI interfaces as static, meaning non-moving.
GUI interfaces are also economical, they are drawn and done without wasting time.
They only change based on something happening. In fact most of the scripts I have seen there is a Return instruction just after the Gui, show command.

Given those ideas, why not use something that is also economical: SetTimer. It can be set to call a subroutine as often as you like. It can increment a variable and finish, then wait until the next settimer calls it.
You can use this to show "elapsed time".

If you need something that allows a value to be placed in a field based on when the gui was shown an when you pushed the button consider reading and storing a copy of the variables A_Now or A_TickCount. Just after showing the GUI read and store one of those variables, later when you push a button read the variable again. If you subtract the stored value from the last, you get how long between GUI-shown and button-pushed.

If you want to use the SetTimer command to start a subroutine, place the SetTimer command after GUI, show and before Return.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2010, 4:46 am 
Offline

Joined: July 6th, 2009, 9:58 pm
Posts: 678
If all you want to do is change text on something without killing the GUI the command specifically (for text and edit fields) is

Code:
GuiControl,,ControlVlabel, This is the new text


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Mickers, rbrtryn and 70 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group