tkinter

How to specify a full click in Python Tkinter

The following python line will bind the method "click" to the event when the user presses the mouse button while the pointer is on the widget; no matter where the pointer is when she releases the button. self.bind('<Button-1>',self.click) If I use "ButtonRelease" instead of "Button" in the code, it seems that the method "click" will b...

Python: open a file *with* script?

I have a python script bundled into a application (I'm on a mac) and have the application set to be able to open .zip files. But when I say "open foo.zip with bar.py" how do I access the file that I have passed to it? Additional info: Using tkinter. What's a good way to debug this, as there is no terminal to pass info to? ...

Simple python Tkinter questions about buttons.

Can someone provide me with some example code. I am fairly fluent with python but can't figure this out. So i will be generating a list with say "x" elements from other code. I need Tkinter to display a "x" buttons that can be checked on or off. Then once the user has selected whichever ones they want, they will press GO and more code wi...

tkinter in python. .pack works, but .grid produces nothing

This code works fine and produces checkbuttons in a long long list. def createbutton(self,name): var = IntVar() account = name[0] chk = Checkbutton(self.root, text=account, variable=var) chk.pack(side = BOTTOM) self.states.append((name,var)) The problem is that the list of buttons is so long, that it stretches fart...

Is there a way to write a command so that it aborts a running function call?

I have a widget that measures elapsed time, then after a certain duration it does a command. However, if the widget is left I want I want it to abort this function call and not do the command. How do I go about this? ...

Is there a way to save a captcha image and view it later in python?

I am scripting in python for some web automation. I know i can not automate captchas but here is what i want to do: I want to automate everything i can up to the captcha. When i open the page (usuing urllib2) and parse it to find that it contains a captcha, i want to open the captcha using Tkinter. Now i know that i will have to save th...

Help, the insertion cursor moves one line lower each time!

Every time this code is reopened the insertion cursor moves one line lower, how do I stop this? import Tkinter,pickle class Note(Tkinter.Tk): def __init__(self,parent): Tkinter.Tk.__init__(self,parent) self.parent = parent self.Main() self.load_data() self.protocol("WM_DELETE_WINDOW", self.sa...

Tkinter Global Binding

Is it possible to bind all widgets to one command, with a single line? It would be nice if I could type in one line as opposed to doing each widget individually. ...

Add a margin to a tkinter window

So I have so far a simple python tkinter window and i'm adding text, buttons, etc. snippet: class Cfrm(Frame): def createWidgets(self): self.text = Text(self, width=50, height=10) self.text.insert('1.0', 'some text will be here') self.text.tag_configure('big', font=('Verdana', 24, 'bold')) self.text["state"] = "dis...

Help with Tkinter Alpha

I have a python program that has no windows frame and doesn't show up in the taskbar because of self.overrideredirect(1). This program has an options menu (a top level widget) that allows for the alpha to be adjusted with self.attributes("-alpha", 0.85). However when I close out of the options menu my program shows up in the task bar. Ob...

How do I get window attributes in Tkinter?

self.attributes("-alpha", Alpha) How do I get window attributes in Tkinter? Currently I wan't my program to get the value of Alpha. ...

Underline Text in Tkinter Label widget?

I am working on a project that requires me to underline some text in a Tkinter Label widget. I know that the underline method can be used, but I can only seem to get it to underline 1 character of the widget, based on the argument. i.e. p = Label(root, text=" Test Label", bg='blue', fg='white', underline=0) change underline to 0, and i...

Python Tkinter Text Widget .get method error

Hi, I'm very new to Python, sort of following Dive into Python 2 and wanted to dabble with some Tkinter programming. I've tried to make a little program that takes 3 sets of words and makes combinations of each word in the 3 sets to make keywords for websites. When I run the script, the GUI appears as expected, but I get the following e...

How do I tell which widget triggered an event in Tkinter?

I have several widgets bound to the same function call. How do I tell which one triggered that call? ...

Why does the tkinter progress bar makes things so much slower?

Hello, I have the following code for extracting a tar.gz file whilst keeping tabs on the progress: from __future__ import division import tarfile import os theArchive = "/Users/Dennis/Instances/atlassian-jira-enterprise-4.1.2-standalone.tar.gz" a = tarfile.open(theArchive) tarsize = 0 print "Computing total size" for tarinfo in a: ...

The Tkinter Entry widget

Is there any way to make the widget so that text can be highlighted and copied, but not changed? ...

Putting images in a Tkinter

How can I place an image in a Tkinter GUI using the python standard library? ...

[python]How to add Auto-scroll on insert in Tkinter Listbox?

I'm using a listbox (with scrollbar) for logging: self.listbox_log = Tkinter.Listbox(root, height = 5, width = 0,) self.scrollbar_log = Tkinter.Scrollbar(root,) self.listbox_log.configure(yscrollcommand = self.scrollbar_log.set) self.scrollbar_log.configure(command = self.listbox_log.yview) Now, when I do: self.listbox_log.insert(EN...

Tkinter button command activates upon running program?

I'm trying to make a build retrieval form, and seem to have issues with the buttons... I'm a novice at Python/tkinter GUI programming (and GUI programming in general) and borrowed the skeleton of a Hello World app, and sorta built off that. In the code below, I've set the "command" option of my Browse button to call my class's internal ...

Two Tkinter Images...

I have written a simple GUI in Python using the Tkinter library. This GUI has to display 2 images, one on top and one on the bottom. When I place the two images on the window, there seems to be a white line between the two. How to I place them so this doesn't show up? I am programming on Windows 7 with Python 2.6 ...