tkinter

Python 2.7/Windows: Create resizable, multiline tkinter/ttk labels with word wrap

Is it possible to create a multi-line label with word wrap that resizes in sync with the width of its parent? In other words the wordwrap behavior of Notepad as you change the width of the NotePad window. The use case is a dialog that needs to present a block of multi-line text (instructions) in its entirety without having the text clip...

Python 2.7/Windows: tkinter/ttk widgets with transparent backgrounds, ttk frame background colors

Is it possible to configure tkinter or ttk widgets (Label, Entry, Text) with a transparent background so that they can be placed in containers with custom background colors or on top of canvas graphics or images? I'm also looking for a way to change the background color of a ttk Frame widget? Do I need to use the new ttk Style objects ...

tkFileDialog.askopenfilename How to specify a different drive?

I'm using "tkFileDialog.askopenfilename" to get a file name variable. I know that I can set the "initialdir" option, but not everyone who uses the program will have the target file on the same drive. For example: the file could be located on the C:, D:, E: etc... I don't see a way to view available drives with the dialog box they have op...

Python 2.7/Windows resizable ttk progressbar?

I'm experimenting with Python 2.7's new Tkinter Tile support (ttk). Is there a way to make the ttk.Progressbar() control auto-resize in proportion to its parent container? In reading the documentation on this control, it appears that one must explicitly set this widget's height or width? I'm looking for a way to place the ttk.Progressba...

Python Tkinter Help Menu

I have a paragraph of help information that I would like to display in a window with an "ok" button at the bottom. My issue is formatting...I want to be able to simply set the paragraph equal to a variable and then send that variable to a message box widget. By default, it formats laterally and in a very ugly manner. Any advice? def abo...

High(er) level frameworks that wrap Tkinter/ttk

Curious if there are any higher level frameworks that attempt to wrap Tkinter? For example, wxPython is wrapped by the Dabo framework (http://dabodev.com/) and PythonCard. Motivation: We've recently moved to Python 2.7 (Windows) and are very impressed with the new ttk (Tile) support which allows one to build professional quality, platfo...

Python/Tkinter window events and properties

I've been searching for information on the following Tkinter window features without success. Platform is Windows, Python 2.7. At the end of this post is code that can be used to explore Tkinter window events. How can one detect window minimize/maximize events? The event object returned by binding to a window's event does contain any ...

Tkinter: Set a 'scale' value without triggering callback?

I have a Tkinter GUI where there is a Scale object. I have a callback assigned (by the command constructor parameter) to perform an action when the user changes the scale position. However, there is also a case where the value represented by the scale is modified externally, and so I set the scale position using Scale.set(). In this c...

[python] Tkinter buttons help

I have a class with a button, it runs the command automatically when the gui is constructed (which i dont want it to do) but then doesnt work again after. What am I doing wrong? Builtin commands such as endcommand work as they should. relevant excerpts (ignore the indent problem at the very beginning) class GuiPart(object): def __i...

What is the most popular GUI library for Python in Windows ?

What is the most popular GUI library for Python in Windows ? ...

Python/Tkinter: Using custom mouse cursors under Windows?

Python 2.7/Windows: My understanding is that we can load custom mouse cursors using the cursor='@file.cur' syntax: widget = tkinter.Label( ..., cursor='@help.cur' ) Here's the traceback I receive: Traceback (most recent call last): File "<pyshell#82>", line 1, in <module> widget.config( cursor='@help.cur' ) File "C:\Python27\...

Text in Text Widget as a variable

Hi, so I've got this little Text widget with a scroll bar and I've got a question. How do I make text in this Text widget a variable ? If I made this text a variable I would be able to open a text file and edit it's text or save the text I've written, etc or maybe it's a wrong way that I'm approaching this, is there a better way to do t...

Python/Tkinter: Mouse drag a window without borders, eg. overridedirect(1)

Any suggestions on how one might create event bindings that would allow a user to mouse drag a window without borders, eg. a window created with overridedirect(1)? Use case: We would like to create a floating toolbar/palette window (without borders) that our users can drag around on their desktop. Here's where I'm at in my thinking (ps...

Menubuttons located in the middle of menubar

Hi, how do I put my menu bar buttons on menu bar's left ? Right now I pack() them with side=LEFT but still they're in the middle. Here's the code for my menu bar: http://pastebin.com/bgncELcb ...

best way for a c# developer to break into Tkinter?

I'm a full time c# developer, but I want to get more into Python. At the same time, I have a friend who will learn it with me, he however has no programming knowledge. I was thinking about starting with some visual programming. I.E: having buttons, labels and text boxes on a form. Does some kind of IDE exist which allows you to very ...

Python/Tkinter: Are Tkinter StringVar (IntVar, etc) thread safe?

Are Tkinter StringVar (IntVar, FloatVar, etc) thread safe, eg. can a background thread read or write to these objects? Or must I use a Queue to pass information between my background thread and my main Tkinter GUI thread and have my main Tkinter thread pop the Queue and update the application's StringVar's accordingly? I know my applica...

tkinter python button run in background command

Hi I'm mucking about with Tkinter and Python. I have a basic gui with a couple of buttons on, one button goes away and does something that takes some amount of time, which is variable. The problem is when I hit this button the whole of my gui locks up/ doesnt show correctly - I guess because its trying to do these things that take some ...

How do I get a windows current size using Tkinter?

How do I get a windows current size using Tkinter, or possibly with the python standard library? ...