[Tkinter-discuss] Button event calls Leave/Enter

engelbert gruber grubert at users.sourceforge.net
Sun May 12 15:54:19 EDT 2019


not reproducable on macos python3.7.3 tkinter8.6.8



On Sun, 12 May 2019 at 20:23, Vasilis Vlachoudis <Vasilis.Vlachoudis at cern.ch>
wrote:

> xubuntu to be more precise
>
>
>
> ________________________________________
> From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=
> cern.ch at python.org] on behalf of Vasilis Vlachoudis [
> Vasilis.Vlachoudis at cern.ch]
> Sent: Sunday, May 12, 2019 19:49
> To: Michael Lange; tkinter-discuss at python.org
> Subject: Re: [Tkinter-discuss] Button event calls Leave/Enter
>
> Hi Michael,
>
> I am using Ubuntu 19.04
> with python 3.7 and tk 8.6.9+1
>
> Vasilis Vlachoudis
> Dep EN, CERN
> CH-1211 GENEVA 23
> SWITZERLAND
>
> Phone:  +41-22 767 9851
> GSM:    +41-75 411 4378
>
>
> ________________________________________
> From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=
> cern.ch at python.org] on behalf of Michael Lange [klappnase at web.de]
> Sent: Saturday, May 11, 2019 00:57
> To: tkinter-discuss at python.org
> Subject: Re: [Tkinter-discuss] Button event calls Leave/Enter
>
> Hi,
>
> On Thu, 9 May 2019 07:58:42 +0000
> Vasilis Vlachoudis <Vasilis.Vlachoudis at cern.ch> wrote:
>
> > Hi all,
> >
> > I've just realized that the mouse click <Button-1> event generates as
> > well a <Leave> followed by <Enter> event before.
>
> what system are you using and which version of Tcl/Tk?
> I cannot reproduce that behavior here (Debian, Tk 8.6.6).
>
> Regards
>
> Michael
>
> > With the program below, if one clicks in the frame
> > you get the messages printed
> > Leave event
> > Enter event
> > Button1 pressed
> > Which I don't understand the reasoning behind. However it generates
> > a problem to my application since I have some actions that are binded
> > with the Leave event and when the button1 handler is called the program
> > has already altered some structures.
> > Is there a way forbit the calls to Leave/Enter before the Button1?
> >
> > Many thanks in advance
> > Vasilis
> >
> > import tkinter as tk
> > def enter(event): print("Enter event")
> > def leave(event): print("Leave event")
> > def button1(event): print("Button1 pressed")
> >
> > root = tk.Tk()
> > frame = tk.Frame(root, bg="Yellow",
> > takefocus=False,
> > width=600, height=400)
> > frame.pack(fill=tk.BOTH, expand=tk.YES)
> > frame.bind("<Enter>", enter)
> > frame.bind("<Leave>", leave)
> > frame.bind("<Button-1>", button1)
> > root.mainloop()
> >
>
>
>
> .-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.
>
> Virtue is a relative term.
>                 -- Spock, "Friday's Child", stardate 3499.1
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20190512/04b0907d/attachment-0001.html>


More information about the Tkinter-discuss mailing list