tkinter

Python: removing a TKinter frame

I want to remove a frame from my interface when a specific button is clicked. This is the invoked callback function def removeMyself(self): del self However, it doesn't remove itself. I'm probably just deleting the object in python without updating the interface ? thanks Update self.itemFrame = tk.Frame(parent) self.itemFrame....

TKinter: How can I set the default value of my slider to 100 ?

How can I set the default value of my slider to 100 ? self.slider = tk.Scale(self.leftFrame, from_=0, to=256, orient=tk.HORIZONTAL, command=updateValue) thanks ...

Tkinter unexpected behaviour

Hi everyone, I've been writing a long GUI in Python using Tkinter. One thing that I don't understand is why I can't bind events to widgets in a loop. In the code below, binding works well if I do it manually (commented out code) but not in a for loop. Am I doing something wrong? import Tkinter root = Tkinter.Tk() b1 = Tkinter.Button(...

Py2exe with Tkinter

I'm trying to convert a basic tkinter GUI program to an .exe using py2exe. However I've run into an error using the following conversion script. # C:\Python26\test_hello_con.py py2exe from distutils.core import setup import py2exe setup(windows=[r'C:\Python26\py2exe_test_tk.py']) C:\Python26\py2exe_test_tk.py is the following code ...

TkInter, slider: how to trigger the event only when the iteraction is complete ?

I'm using the slider to update my visualization, but the command updateValue is sent everytime I move the slider thumb, even for intermediate values. Instead I want to trigger it only when I release the mouse button and the interaction is complete. self.slider = tk.Scale(self.leftFrame, from_=0, to=256, orient=tk.HORIZONTAL, command=up...

TKInter, geometryManagers: grid() and pack()

What's the main difference between the 2 GeometryManagers in TKinter, grid() and pack() what do you use for your projects ? If grid is better to align object, what the main purpose of pack? thanks ...

TKinter: AttributeError: 'NoneType' object has no attribute 'tk' !?

What does this error message mean ? AttributeError: 'NoneType' object has no attribute 'tk' thanks ...

TKinter: how to change Frame width dynamically

how can I set width to a tk.Frame (post-initialization ?) In other words, is there a member function to do it ? Sometheing like frame.setWidth() thanks ...

How can I trigger and listen for events in python ?

How can I trigger and listen for events in python ? I need a practical example.. thanks Update #add Isosurface button def addIso(): #trigger event self.addButton = tk.Button(self.leftFrame, text="Add", command=addIso) #.grid(column=3, row=1) self.addButton.pack(in_=self.leftFrame, side="right", pady=2) ...

Is TKinter widely used to build user interfaces ?

In which kind of application is TKinter usually used ? I'm doing a project in python in which I'm using it for the first time to build a simple user interface. I was wondering if this is widely used for specific applications, or mobile applications.. etc thanks ...

Widgets disappear after tkMessageBox in Tkinter.

Every time I use this code in my applications: tkMessageBox.showinfo("Test", "Info goes here!") a message box pops up (like it is supposed to), but after I click OK, the box disappears along with most of the other widgets on the window. How do I prevent the other widgets from disappearing? Here Is My Code: from Tkinter import * im...

Frame resizing issue in Tk/ttk python

I'm creating a GUI using Tkinter/ttk in Python 2.7, and I'm having an issue where a Frame will resize itself once a widget is placed inside of it. I am new to Python and haven't used Tkinter before. example: ROOT = Tk() FRAME = ttk.Frame(ROOT, width=300, height=300, relief='groove') FRAME.grid() ROOT.mainloop() will produce a groo...

Python 2.7: Themed "common dialog" tkinter interfaces via Ttk?

Python 2.7 (32-bit) Windows: We're experimenting with Python 2.7's support for themed Tkinter (ttk) for simple GUI's and have come away very impressed!! The one area where the new theme support seems to have come up short is how OS specific common dialogs are wrapped. Corrected: In other words, the MessageBox and ColorChooser common dia...

Pygtk VS Pyqt VS WxPython VS Tkinter

What is the most used of these library and why ? What are the differences ? ...

How can I dynamically change the color of a button in Tkinter ?

How can I dynamically change the background color of a button in Tkinter ? It only works when I initialize the button: self.colorB = tk.Button(self.itemFrame, text="", bg="#234", width=10, command=self.pickColor) I've tried this: self.colorB.bg = "#234" but it doesn't work.. thanks ...

Python 2.7/Windows: How to control position of Tkinter common dialogs?

Python 2.7 under Windows: How can we control the position of Tkinter's common dialogs? Here's what we've discovered: Certain common dialogs always open up relative to their parent window Certain common dialogs always open up centered on the user's desktop All common dialogs appear to ignore the optional parent= parameter Questions: ...

GUI-embeddable Python drawing widget with anti-aliasing

I am writing a small diagram drawing application (similar to Graphviz in spirit), and need a GUI library that would allow me to embed a canvas capable of drawing anti-aliased lines and text. I want to have a text editor in one half of the window to edit the diagram code and a (perhaps live) preview pane in the other. Right now I have th...

Auto truncation of a Tkinter label

I have a label sitting on a frame which is updated periodically to show the status of the application. Periodically, the name of the item being processed will not fit into the window, and with the way I currently have the label configured the window expands to accomidate the label. Ideally, I'd like way to smartly truncate the text o...

How would I go about playing an alarm sound in python?

I have a clock I made and I'd like to make it an alarm clock. ...

Python 2.7/Windows: ttk combobox dropdown shows up underneath topmost root window

I'm experimenting with the new ttk Tile enhancements that ship with Python 2.7. Windows 7: The code below demonstrates how the combobox dropdown shows up BEHIND our root window when the root window is configured as a topmost window ("always on top"). If you comment out the line """ root.attributes( '-topmost', 1 )""" then the combob...