[python-win32] Default button change notification

Tim Roberts timr at probo.com
Fri Nov 19 18:33:40 CET 2004


On  Thu, 18 Nov 2004 15:50:05 -0800, "Howard Lightstone" 
<howard at eegsoftware.com> wrote:

>I have some buttons on a Canvas that act properly when Tab is used (a 
>dim gray highlight 'ring" shows on the button).
>
>Is there some way to change the color of the ring (or any other color 
>change) when the button is the "default" button?  Focus events don't do 
>the right thing.  I saw a request for a <Traverse-IN> event on a Tk list but 
>that was too recent to actually be implemented on the 8.3 version I have 
>available.  I can't seem to find anything to hook onto when the "default" 
>button (which takes action on the spacebar) changes.
>

I'm not exactly sure we're on the same page.  The term "default button" 
has a very specific meaning in Windows -- it is the button that fires 
when you hit Enter in a dialog, whether or not it has the focus.  It is 
the "OK" button for the dialog.  Spacebar fires the button with focus, 
which might or might not be the "default button".

The default button has a thicker border at all time, using the default 
button highlight colors.  A button with focus gets a slightly thicker 
border and a dotted line around the button text.

Some of this can be changed by the Windows XP theme, but if you want 
something fancier than that, you'll have to use an owner draw button.

-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-win32 mailing list