954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Tkinter GUI Issues:

I have two questions regarding Tkinter GUIs:I have three buttons in a GUI; at times it seems that the buttons "stick". By this I mean when the mouse is clicked on one it may activate or it may not. They all work correctly in regards to there function(s) but it sometimes takes 2-3 clicks to actually get it to fully respond; I figure that this may have to do with my system, memory resources, or something of that nature. The way in which they tend to not resond sometimes is completely random it seems. Has anyone had this issue before and if so, is their a technique to fix this via code optimization?
Is there a way to change the color\theme of the border of a frame such as the silver border in the GUI pictured below? This is just a small detail but I would like to be able to have this choice if possible for graphic design reasons. I believe I have read that the color\theme of such a GUI element is system dependent, in this case, Windows XP (the same silver color\theme as my system) Is this indeed true that Tkinter does not allow adjustment of said GUI elements?
[IMG]http://i52.photobucket.com/albums/g31/reranger/untitled.jpg[/IMG]

Thank-you in advance for any help\direction offered,
Matty

mattyd
Posting Maven
2,607 posts since Oct 2006
Reputation Points: 105
Solved Threads: 1
 

Hi!

Ad 1: Show some code ;)

Ad 2: Tkinter isn't responsible for the window decorations, but your window-manager is. So, no, it is not possilbe to change them from Tkinter.

Regards, mawe

mawe
Junior Poster
133 posts since Sep 2005
Reputation Points: 19
Solved Threads: 58
 

Unless you have a huge amount of events in your loop, it could very well be your mouse.

Ene Uran
Posting Virtuoso
1,723 posts since Aug 2005
Reputation Points: 625
Solved Threads: 213
 

Hi mattyd,

Does that image represent a pygame game wrapped inside a Tkinter widget? Is that what you're trying to do?

Running pygame and Tkinter together can be tricky, as both open new threads that listen for user input, and threading bugs are always the hardest to squash. Without seeing the code, I can't tell you exactly what's wrong; my suggestion would be to try decoupling the pygame module from the Tkinter module and see if the problem persists (in other words, comment out the entire game loop and pygame initialization code, put `print "FLAG"; return` commands in the beginning of each button function, and see if "stickiness" is still an issue). Of course, if you're not mixing pygame and Tkinter please say so and I will reconsider the problem.

Hope that helps.

G-Do
Junior Poster
147 posts since Jun 2005
Reputation Points: 41
Solved Threads: 31
 
Unless you have a huge amount of events in your loop, it could very well be your mouse.

Not a lot of events. Think it could be the optical mouse. Changed batteries-- works much better.

Thanks, Ene
MattyD

mattyd
Posting Maven
2,607 posts since Oct 2006
Reputation Points: 105
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You