July 20th, 2013, 02:14 AM
Can timer coding possible in text widget
Is it possible to code timer (HH:MM:SS) using text widget with Tkinter. I know we can do this with label widget. My code deals with text widget and want to display time at any corner of the window. any suggestions..
July 20th, 2013, 10:04 AM
Change the user interface plan
You want the time to be part of the text during editing?
The Text widget does not allow insertions beyond the end of current text. Let t be a new Text widget.
t = tkinter.Text()
places the time in the top left corner. To place initially place the text anywhere in the window you'd need to fill the window with some combination of new lines and horizontal white space, creating new problems.
These troubles discourage me. There's other space on the display the time.
- The user can access more of the text box unless you actively and carefully manage every every character entered.
- Do you want the Text box to behave as a normal Text widget? You'd need to understand normal behavior. This problem stopped me from implementing code.
- You'll need to adjust the content of the displayed portion of text during scrolling as well.
- When the text is extracted via copy, save or send you'll need to remove the time stamp and additional white space.
I favor the "keep the entry point visible" concept. Follow this link to mouse-avoidance-mode for an easier and more reusable idea for preventing occlusion. To compute coordinates of a time label widget I'd solve a system of equations with force inversely proportional to separation, boundaries of the text box, coefficients of sliding and of static friction, contained within an underlying canvas.
[/code] are essential for python code and Makefiles!
July 25th, 2013, 12:55 AM
My code is with text widget, can i change my code to label widget, label widget had the default option of anchor= CENTER. This options controls where the text is positioned if the widget has more space than the text needs. The default is anchor=CENTER, which center's the text in the available space.And more over i think it is easy to code timer in label widget, if i change my code to label widget.