tkinter

Linking Tcl/Tk to Python 2.5

Hi, I have an existing Python 2.4 and it is working properly with tkinter as I tested it using python import _tkinter import Tkinter Tkinter._test() Now, I have installed python 2.5.2 but when I try the same tests (with the newer version), it returns (but the same tests are working for the previous ve...

How to intercept WM_DELETE_WINDOW on OSX using Tkinter

I'm trying to keep a Toplevel window from being closed in OSX by intercepting window manager WM_DELETE_WINDOW event. #!/usr/bin/env python from Tkinter import * def speak(): print "woof" root = Tk() root.title("root") win = Toplevel() win.title("win") win.protocol('WM_DELETE_WINDOW', speak) root.mainloop() When I run this I g...

Hide console for Tkinter app on OSX

I'm trying to hide the Terminal when I launch a GUI Tkinter based app, but when I double click the app.py file on OSX, the Terminal window appears. I've tried changing the extension to .pyw and tried launching it with /usr/bin/pythonw, but no matter what, the Terminal window still appears. I've even tried adding the try/except below,...

python pygame + tkinter + py2exe = Segmentation Fault

Hi all, I have made a pygame application, which I sucessfuly compiled to an exe using the pygame2exe script from pygame website. Now I made a small launcher with startup options for the application, using Tkinter, and everything work smoothly. The problem comes when I try to compile the application to exe, using the same script as abo...

[Python] How to add a scrollbar to a window with tkinter?

I have a tkinter program: import urllib.request from tkinter import * root = Tk() root.iconbitmap(default='icon.ico') root.wm_title('Got Skills\' Skill Tracker') frame = Frame(width="500",height="500") frame.pack() def show(): name = "zezima" page = urllib.request.urlopen('http://hiscore.runescape.com/index_lite.ws?player=' + na...

How could I get a Frame with a scrollbar in Python's Tkinter?

I'm starting to learn about Tkinter. I'd like to have a container widget ( Frame ), where the user could add as many textfields as needed by the application. The application starts with a textfield, and a button below that textfield. When the user presses the button, a new text entry will be added below the first one ( this may be repeat...

Is it possible to make a custom mouse cursor with Python Tkinter? (Using matplotlib with the TkAgg backend)

It's likely that this is just a general Python Tkinter question, not necessarily a matplotlib one. So I'm in the midst of developing a rather large suite of plotting functionality on top of matplotlib using the Matplotlib "TkAgg" backend (Agg rendering to a Tk canvas using TkInter). I'm using some of the default zooming functionality p...

getting the absolute path of a file object

I am using file = tkFileDialog.askopenfile(parent=root,mode='rb',filetypes=[('Subrip Subtitle File','*.srt')],title='Choose a subtitle file') to get a file object specified by the user. Is there any way I can get the absolute path of this file from the File object? ...

Make Tkinter jump to the front.

How do I get a Tkinter application to jump to the front. Currently the window appears behind all my other windows and doesn't get focus. Is there some method I should be calling? ...

Starting Python script without explicitly having X11 open

I had Python v2.3 on my system. When I wanted to run a Tkinter script I could just use python myscript.py I recently upgraded to Python 2.5 and now I need to have X11 running and the "DISPLAY" environment variable set before I can run any of my scripts. This is bad for me, because I can't distribute any scripts without explicitly stat...

How to launch a Python/Tkinter dialog box that self-destructs?

Ok, I would like to put together a Python/Tkinter dialog box that displays a simple message and self-destructs after N seconds. Is there a simple way to do this? Thanks, --Steve ...

Making python/tkinter label widget update?

I'm working on getting a python/tkinter label widget to update its contents. Per an earlier thread today, I followed instructions on how to put together the widgets. At runtime, however, the label widget does NOT change contents, but simply retains its original content. As far as I can tell, decrement_widget() is never called at all. Any...

Make a tkinter window appear over all other windows

#!/usr/bin/env python # Display window with toDisplayText and timeOut of the window. from Tkinter import * def showNotification(notificationTimeout, textToDisplay): ## Create main window root = Tk() Button(root, text=textToDisplay, activebackground="white", bg="white", command=lambda: root.destroy()).pack(side=LEFT) r...

Python - Tkinter - Padding woes

Hello, I have a scrollbar widget that ALWAYS hides the last 15 px under the resize button, is there an option to stop this happening on mac or a padding "under" the widget option?\ thanks! ...

Refreshing a window in Tkinter

I am trying to make a GUI in Tkinter and am wondering how to refresh a window, namely if I fill in a rectangle, I want the GUI to delete it a specified time later. How would I go about doing this? Documentation on Tkinter seems to be thin... ...

Crash reporting in Python

Is there a crash reporting framework that can be used for pure Python Tkinter applications? Ideally, it should work cross-platform. Practically speaking, this is more of 'exception reporting' since the Python interpreter itself hardly crashes. Here's a sample crash reporter: ...

Tk treeview column sort

Is there a way to sort the entries in a Tk Treeview by clicking the column? Surprisingly, I could not find any documentation/tutorial for this. ...

Asyncore not working properly with Tkinter GUI

At this point I'm still a noob when it comes to GUI and network programming so I'm hoping this will be a very simple fix. I've got a very basic understanding of the tkinter and asyncore modules having built a handful of programs in each of them, however I'm having trouble using both of them together in a program. I put together an entire...

Tkinter help viewer

I have a simple Tkinter app in Python. I'd like to add help document to it; what is the simplest way to integrate an help viewer to the app? Preferably cross-platform (although I primarily use Windows)? I can imagine writing the help in plain HTML. ...

How to connect two state circles with an arrow in tkinter?

I am currently writing a fsm editor with tkinter. But, I stuck on connecting two states. I have two questions: 1) How can make the transition arrow growable according to mouse movement? 2) How can I stick the starting point of the arrow on a state and the end point of the arrow on another state? PS. Do you think the documentation of t...