tkinter

Removing the TK icon on Python Tkinter windows

Does anybody know how to make the icon not show up? I'm looking for a way to have no icon at all. (Not a replacement) ...

How do you set a Tkinter frame size?

This is the code that's giving me trouble. f = Frame(root, width=1000, bg="blue") f.pack(fill=X, expand=True) l = Label(f, text="hi", width=10, bg="red", fg="white") l.pack() If I comment out the lines with the Label, the Frame displays with the right width. However, adding the Label seems to shrink the Frame down to the Label's si...

Is there a known Win32 Tkinter bug with respect to displaying photos on a canvas?

I'm noticing a pretty strange bug with tkinter, and I am wondering if it's because there's something in how the python interacts with the tcl, at least in Win32. Here I have a super simple program that displays a gif image. It works perfectly. from Tkinter import * canvas = Canvas(width=300, height=300, bg='white') canvas.pack() ...

tkinter - set geometry without showing window

I'm trying to line up some label and canvas widgets. To do so I need to know how wide my label boxes are. I'd like my widget to auto-adjust if the user changes the system font size, so I don't want to hard code 12 pixels per character. If I measure the label widget it's always 1 pixel wide. Until I call .update(), then I get the corr...

Status of shift and caps lock in Python

I'm writing a TkInter application using Python 2.5 and I need to find out the status of the caps lock and shift keys (either true or false). I've searched all over the net but cant find a solution. ...

Python Tkinter Shell to GUI ?

I have created a program that prints results on command line. (It is server and it prints log on command line.) Now, I want to see the same result to GUI . How can I redirect command line results to GUI? Please, suggest a trick to easily transform console application to simple GUI. NOTE:It should work on Linux And Windows. ...

File Dialog in Tkinter Python3k ?

I want to select file from a dialog box. Here is code that does all I need but tkMessageBox Not Found. I am using Py3k. How should I solve this problem? Or Is there any other way to create File Dialog in python? Thanks ...

Python tkinter label won't change at beginning of function

I'm using tkinter with Python to create a user interface for a program that converts Excel files to CSV. I created a label to act as a status bar, and set statusBarText as a StringVar() as the textvariable. inputFileEntry and outputFileEntry are textvariables that contain the input and output file paths. def convertButtonClick(): s...

Dynamically creating a menu in Tkinter. (lambda expressions?)

I have a menubutton, which when clicked should display a menu containing a specific sequence of strings. Exactly what strings are in that sequence, we do not know until runtime, so the menu that pops up must be generated at that moment. Here's what I have: class para_frame(Frame): def __init__(self, para=None, *args, **kwargs): ...

Resetting the main GUI window

I just want the equivalent of closing and reopening my main program. I want to invoke it when a "new"-like option from a drop-down menu is clicked on. Something like calling root.destroy() and then re-initiating the mainloop. How can I get this done? ...

Get Tk winfo_rgb() without having a window instantiated

I know I can call Tkinter.Tk().winfo_rgb(color) to get a tuple of values that represent the named color. for instance Tkinter.Tk().winfo_rgb("red") returns (65535, 0, 0) The problem is it also opens a window. I was hoping to abstract some color calculations into a generic color class, and handle whether or not the class was instantiat...

Using multiple listboxes in python tkinter

from Tkinter import * master = Tk() listbox = Listbox(master) listbox.pack() listbox.insert(END, "a list entry") for item in ["one", "two", "three", "four"]: listbox.insert(END, item) listbox2 = Listbox(master) listbox2.pack() listbox2.insert(END, "a list entry") for item in ["one", "two", "three", "four"]: listbox2.insert...

classmethod for Tkinter-Monitor-Window

Hello together, I would like to realise a monitor window that reports the user about ongoing computations. To do so I wrote a little class. But as I would like to use it accross different modules in an easy fashion I thought to implement it with classmethods. This allows to use it in the following way without instances: from MonitorMod...

Updating tkinter labels in python

I'm working on giving a python server a GUI with tkinter by passing the Server's root instance to the Tkinter window. The problem is in keeping information in the labels up to date. For instance, the server has a Users list, containing the users that are logged on. It's simple enough to do this for an initial list: string = "" for user...

How to avoid Gdk-ERROR caused by Tkinter, visual, and ipython?

The following lines cause with ipython a crash as soon as I close the tk-window instance a. import visual, Tkinter a = Tkinter.Tk() a.update() display = visual.display(title = "Hallo") display.exit = 0 visual.sphere() If I close the visual display first, the entire terminal crashes. I run everything on kubuntu 8.10. Is this a bug or a...

Nice IDE for wxPython or Tkinter GUI Development

I've had a little experience developing small command-line apps with Python, I want to move on to developing GUI's with Python, from all the GUI frameworks for Python the ones I feel most inclined to are wxPython and Tkinter but I don't want to code all the GUI by myself at this time. Is there any good GUI IDE for any of this frameworks...

How to scroll automaticaly within a Tkinter message window

Hello together, I wrote the following class for producing "monitoring" output within an extra window. Unfortunately it doesn't scroll automatically down to the most recent line. What is wrong? As I also have problems with Tkinter and ipython: how would an equivalent implementation with qt4 look like? Here is the code: import Tkinte...

How can I begin with Tkinter?

I'm beginner for the GUI programing using Tkinter, so who can tell me some useful sample codes which contains some useful codes. ...

Why in the world does Python's Tkinter break using canvas.create_image?

I've got a python GUI app in the workings, which I intend to use on both Windows and Mac. The documentation on Tkinter isn't the greatest, and google-fu has failed me. In short, I'm doing: c = Canvas( master=frame, width=settings.WINDOW_SIZE[0], height=settings.WINDOW_SIZE[1], background=settings.CANVAS_COLOUR ) file = ...

GUI app spawned from a LocalSystem Service (via CreateProcessAsUser) does not have focus

I have created a service which display a sort of splash screen on the desktop of a specific user and only when that user is logged in (kiosk user). That splash screen, once entered a valid code, will tell that to the service and the service goes to sleep for an x amount of time (depending of the code). The splash screen simply quits. N...