The Tkinter GUI toolkit comes with a scrolled text widget that is called ScrolledText. To get access to it you have to import it separately. It allows you to display large amounts of text in a small space.

Member Avatar
Member Avatar
+0 forum 2

Hello, All ... I have an HTML file which contains pages of formated text, all within a <p> tag, which has an onclick call to a jscript function. This function gets mouse cursor position at the click event, then passes this position to elementFromPoint(pos.x,pos.y) to return my element object, which I then highlight. I did this using this method because it seemed to work best with my nested elements (always <span>) - sometimes nested 15-20 layers deep. This enables me to easily view the level of nesting, and start and end of this block of clicked text, which can sometimes …

Member Avatar
Member Avatar
+1 forum 2

We can run Python2 script in most simple cases if we just use the 2to3.py script found in recent Python versions: F:\Python27\Tools\Scripts>copy \test\output_window_tk.py \test\output_window_tk2.py 1 tiedosto(a) on kopioitu. F:\Python27\Tools\Scripts>2to3.py -w \test\output_window_tk.py RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: set_literal RefactoringTool: Skipping implicit fixer: ws_comma RefactoringTool: Refactored \test\output_window_tk.py --- \test\output_window_tk.py (original) +++ \test\output_window_tk.py (refactored) @@ -1,5 +1,5 @@ -from ScrolledText import ScrolledText -from Tkinter import BOTH, YES, END +from tkinter.scrolledtext import ScrolledText +from tkinter import BOTH, YES, END fn = 'f:/Python27/setuptools-wininst.log' mywin = ScrolledText() RefactoringTool: Files that were modified: RefactoringTool: \test\output_window_tk.py Here we backed …

Member Avatar
+0 forum 0

I am using a Pwm TextDialog (which inherits from ScrolledText which inherits from Text). It is being used as a real time status pop-up window. A good deal of the status messages use a carriage return ('\r') at the end of the message as a way of conserving vertical space, i.e. percentage done messages. If I appendtext() the message raw the carriage return gets translated into a period and the output is quite ugly. Doing a replace() of the '\r' to a '\n' makes for an extremely long status box. I can't find a way to alter the INSERT point …

Member Avatar
Member Avatar
+0 forum 4

hi everyone, I am trying to design an assembler program with Python using Tkinter and so far it is going pretty good. I just have one question: Is there anyway to change the text color of just a selected text using a text area? What I mean is, you know how in python when you insert a comment the color of the comment is different than the color of the statements; same for function definitions etc. Instead of '#' I am using ';' for comments but I have no idea how to implement this. I've googled it up but with …

Member Avatar
Member Avatar
+0 forum 3

hi all, I am designing a text editor program in Python using Tkinter and I was wondering if there's any way to get the current line number when the mouse is clicked somewhere on the text field, i.e the mouse position should determine the current line, like in the python editor window... for the text field I am using a ScrolledText widget. Any help or hint is appreciated :) thx in advance :)

Member Avatar
Member Avatar
+0 forum 2

The End.