Skip to content
Advertisement

Tag: tkinter

Tkinter scrollbar for frame

My objective is to add a vertical scroll bar to a frame which has several labels in it. The scroll bar should automatically enabled as soon as the labels inside the frame exceed the height of the frame. After searching through, I found this useful post. Based on that post I understand that in order to achieve what i want,

Python Tkinter multiple selection Listbox

I have a listbox which is setup with selection=’multiple’. I then try to obtain a list of all the options the user has selected, by the code name.get(ACTIVE). the problem is that it doesn’t not always get all the options I have highlighted in the listbox GUI. If I highlight one, it brings this back correctly. If I highlight two

python tkinter with threading causing crash

I have written a python tkinter code using threads so as the tkinter wizard updates automatically by tkinter mainloop running in the main thread and background process running in separate thread. But I noticed, that python crashes after some time when running the code. Moreover its random in nature but python crashes most of the time. I have written a

Displaying Matplotlib Navigation Toolbar in Tkinter via grid

I’m developing a small Tkinter GUI to draw matplotlib-plots. (It contains a few Entries and assembles the plot according to their content.) I have designed my plotting widget according to http://matplotlib.org/examples/user_interfaces/embedding_in_tk.html, only I use grid instead of pack: That part works. But embedding the NavigationToolbar in the same fashion does not. Tkinter breaks down without error when I include the

Opening and reading a file with askopenfilename

I have the following code where I’m trying to allow the user to open a text file and once the user has selected it, I would like the code to read it (this isn’t a finished block of code, just to show what I’m after). However, I’m having difficulties either using tkFileDialog.askopenfilename and adding ‘mode=’rb” or using the code like

Interactively validating Entry widget content in tkinter

What is the recommended technique for interactively validating content in a tkinter Entry widget? I’ve read the posts about using validate=True and validatecommand=command, and it appears that these features are limited by the fact that they get cleared if the validatecommand command updates the Entry widget’s value. Given this behavior, should we bind on the KeyPress, Cut, and Paste events

Parsing the results of askopenfilenames()?

I’m trying to get a list of filenames from tkinter.filedialog.askopenfilenames() in Python 3.2. I was expecting the output to be a tuple (or maybe a list) with each element containing a filename. As far as I can tell, it’s returning a string with each element contained within curly-brackets {} like so: {C:UsersBVCAPFile1.txt} {C:UsersBVCAPFile2.txt} This is what I get if I

Advertisement