Tkinter: tkButtonDown, tkButtonEnter, tkButtonInvoke, tkButtonLeave, tkButtonUp

Guilherme Polo ggpolo at gmail.com
Mon Sep 1 23:28:39 EDT 2008


On Mon, Sep 1, 2008 at 11:01 PM, akineko <akineko at gmail.com> wrote:
> On Sep 1, 6:34 pm, "Guilherme Polo" <ggp... at gmail.com> wrote:
>> This is an illusion you have, calling those methods are not the way
>> for explicitly controlling button's behavior, not more than generating
>> proper events. The explicit way is to not use a button, instead
>> (ab)use Canvas.
>
> Some of my custom widgets used Canvas.
> When I designed the "sticky" button widget, I briefly considered use
> of Canvas but I rejected because the one I wanted is nothing but
> Button (except "sticky" behaviour).

Can you clarify what is this "sticky" behavior ? Are you referring to
a toggle button ? If yes, then you might be after a simple
Checkbutton:

checkbutton = Tkinter.Checkbutton(indicatoron=False, text='test')

> I understand that use of Canvas provides greater flexibility but I
> felt it was over-kill.
> Your insights are very helpful for me and other people when designing
> a custom widget.
>
> Aki-
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
-- Guilherme H. Polo Goncalves



More information about the Python-list mailing list