tk

How to update Tcl/Tk in Python?

删除回忆录丶 提交于 2019-12-12 08:17:56
问题 Tcl and Tk in their version 8.6 have been out now for about six weeks. However, the files that can be downloaded from Tcl have a different folder structure and lack some files such as tk85.lib (or tk86.lib now) compared to the Tcl folder in Python. My question is: How can Tcl and Tk be updated to 8.6 in Python (including the integration into Tkinter)? The Python version is 2.7 and the operating system is Windows 7. 回答1: I'm thinking you should report a bug and hope the next 2.7 release will

Signifying unsaved changes by prepending * in window title - how to add a black dot in the window close button on Mac OS X?

跟風遠走 提交于 2019-12-12 06:09:33
问题 I am writing a text editor in Tkinter, using a TopLevel window that includes a Text widget. Currently, when a document/buffer contains unsaved changes, I prepend the title of the window with an asterisk as in MyDocument -> *MyDocument , as customary under *nix environments. For that purpose, I am using the edit_modified method of Text as follows: import Tkinter as tk class EditingWindow(tk.Toplevel): # [...] self.text = tk.Text(...) # track modifications of the text: self.text.bind("<

How does Tk calculate widget size?

◇◆丶佛笑我妖孽 提交于 2019-12-12 05:39:44
问题 I want to know what's the exact equation for calculating the widget's fit size. I want to apply that knowledge to dynamically resizing the font of a widget's text, based on the widget's size. 回答1: Tk GUIs usually work the other way round; the widgets reshape to accommodate their content plus whatever margin and border space is defined. (In Ttk widgets, the style specifies many of those values.) That general requested size is then fed as a suggestion into the geometry management engine. What

how get no border effect in tkinter ttk?

限于喜欢 提交于 2019-12-12 05:36:52
问题 To get button no border effect in tkinter tk I used to set borderwidth=0 . Button will merge into background. But I can't get same effect in tkinter ttk. I set borderwidth=0 in style. Button always have borderwidth. I don't know why? 回答1: What you want can be achieved by setting the button relief to flat or borderwidth to 0 using a ttk style. However, some ttk themes don't take into account these style settings, and one of them is the default theme in Windows. Setting the theme to 'clam' or

Need table that can insert other widgets and delete whole rows

半腔热情 提交于 2019-12-12 05:29:22
问题 Working on a part designer in Perl Tk. Each part has several properties, and each property has over a dozen attributes. Some attributes, like property name, property description, are just text entered in a field, others are chosen from a list of specific values, etc. I have the program configured so that each property is a new row in a table. Each row has several columns corresponding to the configurable attributes of each property. Here is my problem. Using Tk::Table I was able to configure

tkinter - Going Back and Forth Between Frames Using Buttons

佐手、 提交于 2019-12-12 05:24:44
问题 I need functions, preferably one function, that can go back and forth between pages when the next and back buttons are pressed. I imagine this could be done by assigning boolean variables to the back and next buttons (not sure if this can be done) to figure out if you're going foward or back down an ordered list of all the pages. The index of the currently raised frame will need to be known. The indexes could be used to figure out the next page and then it would be raised. If the current

How to update a label in python?

為{幸葍}努か 提交于 2019-12-12 04:12:28
问题 I'm new to python, and I was creating a small game when I got a problem. I searched for an answer, found one, yet it didn't work. The game I'm trying to make is more or less a recreation of Cookie Clicker, and I'm trying to make the label which I have the score on update, instead, it creates a new label. from tkinter import * import time master = Tk() def uiPrint(): print("") print(click) blankLine() click = 0 mult = 1 dcp1 = 0 def blankLine(): for i in range(20): print("") def buttonCommand(

How to save Plotchart canvas other than PostScript without displaying it?

有些话、适合烂在心里 提交于 2019-12-12 03:43:42
问题 I read the section OTHER OUTPUT FORMATS of Plotchart documentation, but still can't figure out how to do it. I want to: Save canvas as image without displaying it. So I can run it in batch mode. Save in other format. (ex: jpeg, png...) A brief example is appreciated. 回答1: I didn't try this solution, but the man page you linked describes a saveplot command to store the plot into a Postscript (or other image format) file. Once you created your plot widget, you can do something like .plot

tkinter - Run Function after Frame is Displayed

你离开我真会死。 提交于 2019-12-12 03:25:01
问题 The code below has an onShowFrame function in the OtherPage class that runs when the OtherPage frame is shown. My problem is that everything in the onShowFrame function runs before the frame is actually displayed to the user. I've demonstrated this with time.sleep(5) . What happens is the program sleeps for 5 seconds, remaining on BlankPage, before showing the OtherPage frame. I want the OtherPage frame to be shown first and then anything in the onShowFrame function to run. How would I do

how can you display an image on a gui using tk in python2.7

北慕城南 提交于 2019-12-12 02:33:50
问题 i need away to be able to show an image when i run the python code in its gui form if possible. Also do i have to type in the folder name and file name in the code if you know the answer i tried pil all it did was save the image into a folder i want this on the gui the code for the tk if it is necessary from Tkinter import * root = Tk() toolbar = Frame(root) # All the buttons in my program b = Button(toolbar, text="Home", width=9) b.pack(side=LEFT, padx=2, pady=2) b = Button(toolbar, text=