tkinter

Advanced Tkinter text box?

I am working on a simple messaging system, and need to add the following to a Tkinter text box widget: 1) Spell Check 2) Option To Change Font ( on selected text ) 3) Option to change font color ( on selected text ) 4) Option to Change Font Size ( on selected text ) I have used Google to try and find examples or modules I could use, ...

List sorted by categories in Tkinter?

I'm building a graphical program that will need to show files on both the user's computer and on a remote server. I'm using Tkinter, and I'm definitely a novice with this toolkit. I want to have the files displayed in a box similar to what you would get from a "Details" view in Windows, so that each file has several categories of info(th...

Clear the window in tkinter

I made a tkinter window in python with some widgets like so: def createWidgets(self): self.grid(padx=25, pady=25) self.start = Button(self) self.start["text"] = "Start" self.start["width"] = "15" self.start["height"] = "1" self.start["command"] = self.start_g self.start.grid(row=0, colu...

Calling Tcl procedures with Function pointers as argument from Python

Hi Is it possible to call Tcl procedures that have function pointers (or callback functions) from Python? I am using Tkinter to call Tcl procedures from Python. Python Snippet : proc callbackFunc(): print "I am in callbackFunc" cb = callbackFunc Tkinter.Tk.call('tclproc::RetrieveInfo', cb) Tcl Snippet : proc tclproc::RetrieveI...

Tkinter text highlighting in python

Hello guys. I wanna know how to change the style of certain words, expressions .. etc based on certain pattens. I am using the Tkinter.Text widget and I am not sure how can we do such thing (The same idea of syntax highlighting in text editors). I am not sure even if this is the right widget to use for that purpose. ...

Command for click on Tkinter treeview widget items? Python

I'm creating a GUI with Tkinter, and a major part of the GUI is two Treeview objects. I need the contents of the Treeview objects to change when an item (i.e. a directory) is clicked twice. If treeview items were buttons, I'd just be able to set command to the appropriate function. But I'm having trouble finding a way to create on-click...

Mac Ports Python 2.6.6 and Tkinter

Hi guys, I apologize if this has been asked but does Tkinter work in Python 2.6.6 when installed with Mac Ports? Or do I need to pass the no_tkinter variant? Thanks for any help! ...

In Tkinter is there any way to make a widget not visable?

Something like this Label(self, text = 'hello', visible ='yes') This would make the widget appear normally. Label(self, text = 'hello', visible ='no') While something like this would make the widget not appear at all ...

Tkinter coordinates start at 3?

I have the following code: from Tkinter import * master = Tk() canvas = Canvas(master, width=640, height=480, bd=0) canvas.pack() line_coords = (3, 3, 3, 100) canvas.create_line(*line_coords, fill='red') mainloop() This will draw a line in the top-left corner. Why is it that if I change line_coords to (2, 2, 2, 100) the line does n...

Toplevel widgets in Tkinter

I have a Toplevel widget I'd like it so that it would never appear within the confines of the main Tk window. Basically so that when the Toplevel appears it doesn't cover up any of the main Tk window. ...

Running a command on Window minimization in Tkinter

I have a Tkinter window whenever the minimize button is pressed I'd like to run a command, how do I do this? I know w.protocol("WM_DELETE_WINDOW", w.command) will run a command on exit. ...

Two Tkinter Questions

Is it possible to change the color of certain particular bits of text in the entry widget, or does it all have to be the same color? Is it possible to change the Tk logo in the top right to a different image? ...

Is there a way to make the Tkinter text widget read only?

It doesn't look like it has that attribute, but it'd be really useful to me. ...

MakeTkinter take focus

I have a script that uses Tkinter to pop up a window with a message. How do I make sure it takes focus so the user doesn't miss it and explicitly has to dismis the window. the code is : root = Tk() to_read = "Stuff" w = Label(root, text=to_read) w.pack() root.mainloop() Thanks. ...

Why does Tkinter frame resize when text box is added to it?

With this code, the window is 500 by 500, which is what I'm going for: from tkinter import * root = Tk() frame = Frame(root, width=500, height=500) frame.pack() root.mainloop() When I add a text box to the frame, though, it shrinks to just the size of the text box: from tkinter import * root = Tk() frame = Frame(root, width=500, h...

Running matplotlib in tkinter

I have this beautiful sphere I made in matplotlib. How would I go about putting it in a tkinter frame widget? It'd be nice to be able to integrate it into an existing tkinter GUI. Also is it possible to rid of the menu bar below the display? I have no need to save the output or zoom, so it's useless to me. from mpl_toolkits.mplot3d imp...

Embedding Matplotlib in Tkinter, display problems

I'm currently trying to graph a sphere in a tkinter window using matplotlib. How do I go about making the display square? I'd like the sphere to have as little distortion as possible. My code: #!/usr/bin/env python import matplotlib matplotlib.use('TkAgg') from mpl_toolkits.mplot3d import axes3d,Axes3D import matplotlib.pyplot as plt...

How to run a code whenever a Tkinter widget value changes?

I'm using Python and Tkinter, and I want the equivalent of onchange event from other toolkits/languages. I want to run code whenever the user updates the state of some widgets. In my case, I have many Entry, Checkbutton, Spinbox and Radiobutton widgets. Whenever any one of these changes, I want to run my code (in this case, update a tex...

I embedded a matplotlib graph of a sphere into Tkinter, and can no longer orbit it!

I embedded a matplotlib graph of a sphere into Tkinter. Now for some reason I've lost the ability to orbit the object, when dragging the mouse. Anyone have an idea of why this happened and how to fix this? #!/usr/bin/env python import matplotlib matplotlib.use('TkAgg') from mpl_toolkits.mplot3d import axes3d,Axes3D import matplotli...

Updating a graphs coordinates in matplotlib

I have below a code that will plot a sphere, it's proportions are defined by prop, I'd like it so when the button is pressed prop's value changes to 5 and the graph is adjusted accordingly. How do I go about this? I know tkinter has .configure(), which allows one to adjust widget settings. I'm looking for something similar so that I ca...