[Tutor] Tkinter Button Issue

Adam Cunningham adamc88 at googlemail.com
Sun Jun 28 23:42:15 CEST 2009


Hi, I was hoping someone may be able to help me on an issue I'm having with
Tkinter buttons; or more specifically, the background and foreground
settings.
I've created a program that is supposed to simulate an order system: the
first section (frame) is where the user adds items to the order and the
second section (frame) is where payment is processed. The second section
only activates when the first section has been confirmed by the user; so in
the meantime all buttons in the second section are disabled. They are then
activated so the user can complete the transaction and the first section is
disabled so the order can't be edited during payment.

It all seems to be working great except that when a button is 'activated'
its appearance loses its foreground and background properties, appearing
with the default greyish background and black font. As soon as the mouse
hovers over the buttons the colour corrects itself.

Does anyone have any idea how I can ensure that the colours appear correctly
as soon as the button is activated? Perhaps some way to 'programatically'
focus the mouse on the buttons? Sorry if this sounds idiotic, I'm obviously
still a newbie. :-)

Thanks for your time.

Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090628/78b13eec/attachment.htm>


More information about the Tutor mailing list