tkinter

Is there any way to make Tkinter look less windows 95ish?

I was wondering if there was a way to make tkinter more aesthetically pleasing. ...

Help with cPickle in Python 2.6

I tried the following code I python. This is my first attempt at pickling. import Tkinter import cPickle root = Tkinter.Tk() root.sclX = Tkinter.Scale(root, from_=0, to=1500, orient='horizontal', resolution=1) root.sclX.pack(ipadx=75) root.resizable(False,False) root.title('Scale') with open('myconfig.pk', 'wb') as f: cPick...

Two Tkinter option menu questions

I have the following Tkinter option menu and have two questions.First, how do I change the background color of the selected option in the popupmenu? Secondly, how do I add separators to this menu? Snippet: TL.selectedP = Tkinter.StringVar() TL.opt1 = Tkinter.OptionMenu(TL.separator1, TL.selectedP,'Normal', 'White','Black', 'Bl...

Tkinter Text, undo/redo?

I need to make both a Control-Z and Shift-Control-Z function in a tkinter text widget, so that one may undo and redo things. Anyone have any Idea? ...

Replacing a single color in PIL?

I have an Image, I'd like to replace all the pixels of one color with those in a different color, what is the simplest way to go about that? More or less I have an image in tkinter, and when a button is pressed I want the color to change. ...

Open File With Python

I am writing a tkinter program that is kind of a program that is like a portfolio and opens up other programs also writen in python. So for example i have FILE_1 and FILE_2 and i want to write a program that onced clicked on a certain button opens either FILE_1 or FILE_2. i dont need help with the look like with buttons just how to wir...

Need help making a program remember settings, cPickle

How do I make this code remember the last position of the scale, upon reopening? import Tkinter import cPickle root = Tkinter.Tk() root.sclX = Tkinter.Scale(root, from_=0, to=1500, orient='horizontal', resolution=1) root.sclX.pack(ipadx=75) root.resizable(False,False) root.title('Scale') with open('myconfig.pk', 'wb') as f: ...

Why do I get the following error while trying to use cPickle?

The Error: Traceback (most recent call last): File "<string>", line 244, in run_nodebug File "C:\Python26\pickleexample.py", line 13, in <module> place = cPickle.load(f) cPickle.UnpicklingError: NEWOBJ class argument has NULL tp_new My Code: import Tkinter import cPickle root = Tkinter.Tk() place = 0 root.place = Tkinter.IntVar() ro...

I want to make this program remember settings...

I have tried unsuccessfully several times to get programs to remember settings after they've been destroyed. A large reason for that is because I don't have an example code to work off of. Below I have a simple program I wrote. I'd like it so that it both remembers the position of the scale, and the contents of the text widget upon resta...

How do I make it so a two top level widgets can't be open simultaneously?

I have a top level widget that is created when a button is pressed. How do I make it so when that same button is pressed again, while the top level widget is still open it simply moves the top level widget into focus? ...

How to add Tkinter support for PIL Python library

Okay, well supposedly PIL is supposed to be able to work with Tkinter automatically, but mine is not. I found this text file in the Imaging directories Tk directory. Using PIL With Tkinter Starting with 1.0 final (release candidate 2 and later, to be precise), PIL can attach itself to Tkinter in flight. As a result, you no longer ne...

Tkinter set cursor position?

Hi Is it possible to set the cursor position in a Tkinter Text widget? I'm not finding anything terribly useful yet. The best I've been able to do is emit a <Button-1> and <ButtonRelease-1> event at a certain x-y coordinate, but that is a pixel amount, not a letter amount. Any help would be welcome, Thanks ...

Tkinter grid() Manager

I am having a bit of trouble with the Tkinter grid() manager. It is spacing the rows too far apart. I have two entry widgets to place, and I need one almost directly under the other. When I place them both on the same row and column, but change the pady option, it places them directly on top of each other. I know there has to be a way to...

Is it possible to get widget settings in Tkinter?

It'd be awesome if I could get something like the below. Pseudo Code: U = widget1.SettingsGet() Print U Upon printing U something like this would be returned: widget1(background='green',foreground='grey',boarderwidth=10, relief='flat') It would be really useful to be able to get a widgets settings. So that I can manipulate other ...

What is the simplest way to make tooltips in Tkinter?

For those that don't know, tooltips are those little bits of text that popup when the mouse hovers over a widget for a certain durration of time. I'm using Windows 7 if it makes a difference. ...

I want to limit how often a Tkinter callback is run

I'm writing my first GUI program with Tkinter (first program in Python too, actually). I have an Entry widget for searching, and the results go to a Listbox. I want the results to update as the user types, so I made a callback like this: search_field.bind("<KeyRelease>", update_results) The problem is that updates the search many tim...

Python: Why does the tab character show up weird in Tkinter?

This a screenshot from a Tkinter Listbox in a program I'm writing: Why does the \t character show up as a black bar? On a Mac it shows up normally (as a tab), but on Windows I get this. I think it might have something to do with character encoding because strings are unicode by default in OS X but not Windows? I tried writing the ta...

How to make non-square edges in Tkinter?

In order to make one of my programs more aesthetically pleasing I'm using images to create the boarders, however I want to create a non square boarder so the program looks kinda like this ___________ / / /__________/ How should I go about this? This is on windows 7, btw. Edit: A tried to make a pseudo-edge using tra...

Making non-square borders in Tkinter

I have a program that looks like the following What is the easiest way to give it slanted edges, like the following? This is in windows 7, btw. Also example codes are much appreciated. ...

How do I make Tkinter support PNG transparency?

I put in a partially transparent PNG image in Tkinter and all I get is this How do I make the dark triangle on the right clear? (like it's supposed to be) This is python 2.6 on Windows 7, btw. ...