7/15/2023 0 Comments 60 minute timer graphic![]() ![]() # A simple graphical Timer Application in Python When value of seconds part reaches 60 minutes part value is incremented by 1 after resetting seconds to 1. In the example we have passed one second as delay to increment seconds. Sleep– this method is defined in the time module and is used to delay program execution by number of seconds passed as parameter. In our Python Timer Code this function is used for associating timer start with mouse click. It is called with a GraphWin object without any parameters. ![]() It returns X and Y coordinate values of window where the mouse has been clicked. GetMouse– This method listens to the mouse for a click action. The timer window is closed if user has pressed a key or clicked mouse. The loop is stopped with break statement. In the Python Timer Code this method is checked in the loop used to increment and display time. It returns the last key typed or mouse click. In the Python Timer Code this method is called with the text that stores the minutes and seconds of the timer to clear it before drawing the next timer value after incrementing in while loop.ĬheckMouse– This method is called with a declared GraphWin object. ![]() It is called with any declared and initialized graphics object. Undraw– this method clears the specified graphics object. The values allowed are strings ‘helvetica’, ‘arial’, ‘courier’ or ‘times roman’. SetFace– this method is used to set the font face of a Text object. The values allowed are strings ‘bold’, ‘normal’, ‘italic’ and ‘bold italic’. SetStyle– this method is used to set the text style of a Text object. An integer value of maximum value 36 can be passed. SetSize– this method is used to set the text size of a Text object. ![]()
0 Comments
Leave a Reply. |