tk

Threads And Time + Tkinter In Python

时光毁灭记忆、已成空白 提交于 2019-12-12 01:57:05
问题 In tkinter I have made a password GUI some people have helped me with other things with it. The problem is: I have made a file called timeload in it there is a while loop. When I import it into my program it gets stuck on the import because inside of timeload there is the loop. I think there is a way to do it with threads but I do not know how to implement that into my code. Here is the main code: import tkinter as tk from threading import Thread import timeload class FirstFrame(tk.Frame):

How to add a Tkinter Text Variable in canvas text

百般思念 提交于 2019-12-12 01:54:49
问题 I am trying to make a basic weather widget where some text overlays a picture. The text being the current temperature, the image being a representation of the weather outside eg: Cloudy, Sunny... To get hold of the weather, I am using the Python Weather API import pwapi I have the temperature saved to variable. var = StringVar(root) var.set(temperature) I have used if statements to determine which image to display. However, my problem lies here: weather_canvas.create_text(135, 130,

Tcl/Tk: How to scale the widgets when the user changes the size of the window

北慕城南 提交于 2019-12-12 00:32:51
问题 I have a window with widgets inside it. When I re-size the window manually, the widgets will scale them self when the height is reduced, but not when the width is changed or when the height is enlarged beyond the initial height. How do I make the widgets to be stack to the borders of the window? The code for the creation of the window: wm title $base "KitKite Sparam Viewer" set frm_main [frame $base.main_frm] pack $frm_main grid [frame $frm_main.graph ] -row 1 -column 1 set g [sparam_graph

How to resize the image on label widget

青春壹個敷衍的年華 提交于 2019-12-11 18:27:19
问题 Currently, I use label widget with the -image option to display a image on the TK GUI as following : image create photo plot1 -file new.gif label .la1 -image plot1 -background white It works well. But now I want to make the image resize as the user drags the GUI. For other tk widget, The columnconfigure and rowconfigure can realize the resize function. But how to do this for image on label? 来源: https://stackoverflow.com/questions/31285918/how-to-resize-the-image-on-label-widget

Tkhtml with python 3.5

丶灬走出姿态 提交于 2019-12-11 17:28:06
问题 I was searching for Tkinter widget for displaying webpage/Url/ads in my Tkinter window widget.and after some google/stack search, I found a widget called (tk_html_widget) and this page where I found Tkhtml...but I don't know how to use both(tk_html_widgets and Tkhtml). Please refer me something for study these(tk_html_widgets and Tkhtml) Thank you 回答1: for an example of hyperlink type behaviour: __all__ = ["LinkScrolledText"] try: from tkinter import scrolledtext except ImportError: import

Tkinter Scrollbar not working

吃可爱长大的小学妹 提交于 2019-12-11 16:24:16
问题 I have a piece of tkinter code running on python 3.4 that is a large frame placed in a canvas with a vertical scrollbar, however the scrollbar is grayed out and doesn't seem to be linked to the size of the frame. The code I'm using is essentially: class EntryWindow: def __init__(self, master): self.master = master self.master.minsize(750, 800) self.master.maxsize(1000, 800) self.canvas = tk.Canvas(self.master, borderwidth=0, bg='#ffffff') self.vsb = tk.Scrollbar(self.master) self.master_frame

How do I change the data in a label in Perl Tk?

牧云@^-^@ 提交于 2019-12-11 15:53:43
问题 I'm trying to create a program with Tk that will take the data from an entry, and, at the click of a button, create a label that has that data. Below is the code I've been debugging. In the process of debugging, I have tried tb]geh following: using references to $printItem have the subroutine connected to -command go to a subroutine combining the above in various ways use Tk; use strict; use warnings; $mw = MainWindow -> new; my $printItem = $mw -> Entry(-width = 20); $printItem -> pack; $mw

Facing problem with overrideredirect(True) method in tkinter on debian based Linux

不羁的心 提交于 2019-12-11 15:20:05
问题 I am developing an GUI using python tkinter in debian based linux . Whenever I am removing root and toplevel window title bar using overrideredirect(True) method I am facing below mentioned problems . Entry field not working( not getting focus/not getting input ) when I am clicking on it. Whenever I use Alt+Tab key then only it get focused. Then I have to keep pressed mouse left or right button on clicked position then only entry field accept input otherwise input is written on terminal

Installing Perl/Tk for texdoctk

此生再无相见时 提交于 2019-12-11 12:01:06
问题 I'm trying to install Perl/Tk for texdoctk , and I used cpan -i Tk to see OK sign. cpan -i Tk ... 2level/perllocal.pod SREZIC/Tk-804.033.tar.gz /usr/bin/make install -- OK However, when I execute the texdoctk, I have this error message. texdoctk algorithms Can't locate Tk.pm in @INC (you may need to install the Tk module) (@INC contains: ... ) at /usr/local/texlive/2014/bin/x86_64-darwin/texdoctk line 15. BEGIN failed--compilation aborted at /usr/local/texlive/2014/bin/x86_64-darwin/texdoctk

When and how to set window size using Tk

纵然是瞬间 提交于 2019-12-11 10:41:55
问题 I'm writing a script to output things to a window comprising a Tkhtml widget and a text widget displayed above each other in a ttk::panedwindow. Both widgets are scrollable both vertically and horizontally. There's also a button allowing the user to clear the text widget. I'm doing some of the development on a laptop running Ubuntu. The window manager allows for four desktop workspaces in a 2x2 array, and when the GUI is first displayed, the bottom fifth or so bleeds from the workspace I'm