Questions tagged [text-widget]

99 questions
72
votes
9 answers

How to clear/delete the contents of a Tkinter Text widget?

I am writing a Python program in TKinter on Ubuntu to import and print the name of files from particular folder in Text widget. It is just adding filenames to the previous filnames in the Text widget, but I want to clear it first, then add a fresh…
Fahadkalis
  • 2,971
  • 8
  • 23
  • 40
14
votes
1 answer

What is the StrutStyle in the Flutter Text widget

What is the StrutStyle in the Flutter Text widget? I've read this documentation but I'm having trouble understanding the meaning, especially the height, leading, and fontSize parameters.
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
7
votes
1 answer

How can you mark a portion of a text widget as readonly?

How can I mark a portion of a tkinter text widget as readonly? That is, I want to be able to allow editing only in certain parts of the widget. For example, I want to allow editing only after a prompt but not before, to simulate a console.
Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
6
votes
2 answers

Tkinter: set StringVar after event, including the key pressed

Every time a character is entered into a Text widget, I want to get the contents of that widget and subtract its length from a certain number (basically a "you have x characters left" deal). But the StringVar() is always one event behind. This is,…
Rory Byrne
  • 923
  • 1
  • 12
  • 22
4
votes
1 answer

Overline Text in Tkinter

I can apply an underline or overstrike style to text in Text widget. Is it possible to do an overline? import tkinter as tk root = tk.Tk() text = tk.Text(root) text.pack(padx=4,pady=4,fill=tk.BOTH,expand=tk.YES) text.tag_configure('underline',…
mcu
  • 3,302
  • 8
  • 38
  • 64
4
votes
2 answers

Undo feature in tkinter text widget

I was trying to use undo function on my text widget in tkinter but without any luck. I tried it this way: from Tkinter import * from ttk import Notebook def OnVsb(*args): text.yview(*args) numbers.yview(*args) def OnMouseWheel(event): …
midori
  • 4,807
  • 5
  • 34
  • 62
3
votes
1 answer

Adjust new line spacing in Flutter Text Widget

So, the objective was very simple, wrap a bunch of text in a container. For that I followed this Flutter- wrapping text , but the new line created, has too much space between the previous line. My code for the Container() with Text(): description…
MarcoFerreira
  • 195
  • 1
  • 14
3
votes
2 answers

Is there a way to rotate text around (or inside) a circle?

typical spinning wheelI am making a spinning wheel in Python tKinter. Usually, when you spin the wheel, you land on a random slice on the wheel, where the random choice is the text displayed on the slice. I am unable to find a way to rotate text on…
No Bounds
  • 43
  • 6
3
votes
1 answer

Automatically resize text widget's height to fit all text

How can one automatically resize a text widget to fit a text widget's height There will not be any \n om the text widget, instead the text will wrap (whole word) around and continue down. wrap=WORD How can this done? My idea of approaching the…
Bjango
  • 333
  • 5
  • 15
3
votes
1 answer

Python Tkinter Text-Widget scroll to specific line

Issue: Loading a code-file from the harddrive into a text-widget created by tkinter (may be larger than xxx lines) Finding a position within this text-widget (line/column) Scrolling the text-widget to that exact position So far I could not find…
Eiden Eiden
  • 87
  • 1
  • 7
2
votes
0 answers

Python/Tkinter writing from right to left (RTL) inside the text widget

-I am looking for a way to change the direction of writing from right to left in the text widget so that the user can write inside it in Arabic language, ie from right to left(RTL). I searched for this topic for several days, but unfortunately I did…
2
votes
1 answer

tkinter.Text widget method dump add parameter

this is content of help about Text widget method from python/IDLE named: dump | dump(self, index1, index2=None, command=None, **kw) | Return the contents of the widget between index1 and index2. | | The type of contents returned…
Traper279
  • 43
  • 4
2
votes
1 answer

Where is the RenderObject class for the Text widget in the Flutter source code

I'm researching how the Text widget works in Flutter. I know that the widgets are just blueprints. It is the Element that implements the widget. And the element makes a RenderObject to layout and paint the widget on the screen. I think that's how it…
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
2
votes
1 answer

How are fonts rendered in Flutter or how do I avoid vertical spacing?

I have two simple Text-Widgets in a Row that have different font sizes. I use CrossAxisAlignment.start to vertically place them at the beginning of the vertical axis. Unfortunately, the two text chunks are not correctly aligned. When I use Flutter:…
2
votes
1 answer

Tkinter widget after method

I haven't found a thread to answer my question, so: My GUI consists of 3 separate "windows" (Frames?) as classes: TextInput, TextOutput and Statistic. For performance reasons I only ran the Statistic.mainloop() but the other classes show up,…
Mister Ieuns
  • 35
  • 1
  • 6
1
2 3 4 5 6 7