tk

How do I disable all the user input widgets (buttons,entries..) from a parent widget?

这一生的挚爱 提交于 2019-12-02 05:40:09
问题 I am designing a GUI using Python and Tkinter. All the buttons and entries required to register the user input commands are placed inside a main frame and are their child widgets. I want to know if it is possible to disable all the input functionality from these widgets by propagating some "disable" flag from the main frame to all the input widgets. In this way, I was hoping to be able to toggle their state in a single line of code. I believe that should be possible. Does anyone know how to

Ruby executable won't start on Win10 and Win7

别来无恙 提交于 2019-12-02 04:51:09
问题 I wrote a ruby application with Tk, and everything is fine, no errors or such. So i made an exe with Ocra and i had some problems at the start but then i solved, Ocra made the exe with no errors and also when it let's you try your script before conpiling it, there were no problems. But then when i double clicked the exe, nothing. I waited, and nothing.. Run it as admin and nothing again.. I also tried to write a simple script, just like an hello world but always the same issue: No errors

Tkinter splash screen & multiprocessing outside of mainloop

家住魔仙堡 提交于 2019-12-02 04:39:48
问题 I have implemented a splash screen that is shown while my application loads the database from remote cloud storage on startup. The splash screen is kept alive (there's a progressbar on it) with calls to .update() and is destroyed once the separate loading process ends. After this, the mainloop is started and the app runs normally. The code below used to work fine on my Mac with python 3.6 and tcl/tk 8.5.9. However, after the update to Sierra I was forced to update tk to ActiveTcl 8.5.18. Now,

Ruby executable won't start on Win10 and Win7

蓝咒 提交于 2019-12-02 03:38:01
I wrote a ruby application with Tk, and everything is fine, no errors or such. So i made an exe with Ocra and i had some problems at the start but then i solved, Ocra made the exe with no errors and also when it let's you try your script before conpiling it, there were no problems. But then when i double clicked the exe, nothing. I waited, and nothing.. Run it as admin and nothing again.. I also tried to write a simple script, just like an hello world but always the same issue: No errors popped up on screen or in cmd, but still nothing happens when i run an Ocra ruby executable with TK This is

Tkinter: How to make Tkinter to refresh and delete last lines?

蹲街弑〆低调 提交于 2019-12-02 01:30:36
Problem is: Clock hands in Tkinter flashes because I use w.delete , but if i don't use it then clock hands duplicate.. Please help. import Tkinter as tk; import time from math import cos,sin,pi import sys root=tk.Tk(); root.title("Clock") w = tk.Canvas(root, width=320, height=320, bg="#456", relief= "sunken", border=10) w.pack() size=300 def funA(): s=time.localtime()[5] m=time.localtime()[4] h=time.localtime()[3] w.update() degrees = 6*s angle = degrees*pi*2/360 ox = 165 oy = 165 x = ox + size*sin(angle)*0.45 y = oy - size*cos(angle)*0.45 t = w.create_line(ox,oy,x,y, fill = "#ffc") degrees1 =

How to find the path of Tcl/Tk library that Tkinter is currently using?

帅比萌擦擦* 提交于 2019-12-01 23:19:45
问题 TCL_LIBRARY and TK_LIBRARY environment variables can be used to bind Tkinter with proper Tcl/Tk installation. How to get the location of Tcl/Tk from working Tkinter instance? (I'm running a frontend in non-virtual Python with working Tkinter and I need to run a tkinter subprocess in a virtual environment. Virtual Python doesn't find Tcl/Tk. I can specify TCL_LIBRARY and TK_LIBRARY manually, but I'd like to have more general solution and extract this information from the parent process.) 回答1:

Tkinter splash screen & multiprocessing outside of mainloop

牧云@^-^@ 提交于 2019-12-01 23:04:08
I have implemented a splash screen that is shown while my application loads the database from remote cloud storage on startup. The splash screen is kept alive (there's a progressbar on it) with calls to .update() and is destroyed once the separate loading process ends. After this, the mainloop is started and the app runs normally. The code below used to work fine on my Mac with python 3.6 and tcl/tk 8.5.9. However, after the update to Sierra I was forced to update tk to ActiveTcl 8.5.18. Now, the splash screen is not displayed until the separate process finishes, but then appears and stays on

How to make Tkinter columns of equal width when widgets span multiple columns (Python 2.7)

你离开我真会死。 提交于 2019-12-01 21:32:31
In the following, the buttons labelled 'ONE', 'TWO', and 'THR' do not get evenly spaced out. It seems to me that the root of the problem is that Tk is assuming a default minimum width for any column containing part of a widget that spans multiple columns. However, this behaviour appears to be undocumented, so I am unsure how to accommodate for or adjust it in order to get the columns to be of equal width - including the two columns spanned by the text widget and the single column not spanned by the text widget - and thus space out the buttons evenly. I could kludge it by trial and error, i.e.

How to find the path of Tcl/Tk library that Tkinter is currently using?

与世无争的帅哥 提交于 2019-12-01 20:32:09
TCL_LIBRARY and TK_LIBRARY environment variables can be used to bind Tkinter with proper Tcl/Tk installation. How to get the location of Tcl/Tk from working Tkinter instance? (I'm running a frontend in non-virtual Python with working Tkinter and I need to run a tkinter subprocess in a virtual environment. Virtual Python doesn't find Tcl/Tk. I can specify TCL_LIBRARY and TK_LIBRARY manually, but I'd like to have more general solution and extract this information from the parent process.) Found the solution myself: import tkinter root = tkinter.Tk() print(root.tk.exprstring('$tcl_library'))

tkinter window get x, y, geometry/coordinates without top of window

最后都变了- 提交于 2019-12-01 17:59:22
I am using tk in python (3), though I'd assume that this applies to any language. I am looking to get the current x, y coordinates of a tk window outside of the title bar: import tkinter root = tkinter.Tk() however, using root.winfo_y() gives me the coordinates including the depth of the titlebar. For a window that is in the upper left corner of my screen: root.winfo_x(), root.winfo_y() # returns (0, 22) In other words, running: root.geometry('+{}+{}'.format(root.winfo_x(), root.winfo_y())) will move down the window by 22 pixels (the height of the title bar) every time I call it. How can I get