tkinter.text

Print tabular formated text into a tk.Text widget, not aligned as its supposed

喜夏-厌秋 提交于 2019-12-25 01:12:13
问题 I couldn't found answer on the internet so I'm hoping you can help me. I'm trying to print from a list into a text box in Tkinter. From some reason, when I print it to text box it's not aligned as its supposed to be but when I print it to the console, its aligned correctly. Data that I'm using you can find on data. Any of you knows what might be the problem? from tkinter import * popup = Tk() popup.wm_title("Podaci mreze") widthTabela = 600 heightTabela = 500 def zatvaranje(): popup.destroy()

Python tkinter text modified callback

淺唱寂寞╮ 提交于 2019-12-19 09:17:39
问题 In python 2.7, I am trying to get a callback every time something is changed in the Tkinter Text widget. The program uses multiple frames based on code found here: Switch between two frames in tkinter The callback part is taken from the following example: http://code.activestate.com/recipes/464635-call-a-callback-when-a-tkintertext-is-modified/ Both codes work fine separately, but combining those two is difficult for me. Here is my attempt with as bare bones code as possible. import Tkinter

Python tkinter text modified callback

天涯浪子 提交于 2019-12-01 07:54:42
In python 2.7, I am trying to get a callback every time something is changed in the Tkinter Text widget. The program uses multiple frames based on code found here: Switch between two frames in tkinter The callback part is taken from the following example: http://code.activestate.com/recipes/464635-call-a-callback-when-a-tkintertext-is-modified/ Both codes work fine separately, but combining those two is difficult for me. Here is my attempt with as bare bones code as possible. import Tkinter as tk class Texter(tk.Tk): def __init__(self, *args, **kwargs): tk.Tk.__init__(self, *args, **kwargs)

Explain Tkinter text search method

☆樱花仙子☆ 提交于 2019-11-26 09:59:18
问题 I don\'t quite understand how text.search method works. For example there is a sentence: Today a red car appeared in the park. I need to find a red car sequence and highlight it. It is found but here is how my highlighting looks like: I am using self.text.search(word, start, stopindex=END) on the sentence. And it looks like search method works exactly like python\'s regexp search. Adding exact=True didn\'t change anything since it is default behavior which is why I don\'t understand what