[Python-bugs-list] [Bug #110823] Tkinter missing button state symbols (PR#132)

noreply@sourceforge.net noreply@sourceforge.net
Wed, 9 Aug 2000 02:21:00 -0700


Bug #110823, was updated on 2000-Aug-01 14:10
Here is a current snapshot of the bug.

Project: Python
Category: Tkinter
Status: Open
Resolution: None
Bug Group: Feature Request
Priority: 5
Summary: Tkinter missing button state symbols (PR#132)

Details: Jitterbug-Id: 132
Submitted-By: aa8vb@yahoo.com
Date: Thu, 18 Nov 1999 08:16:55 -0500 (EST)
Version: 1.5.2
OS: IRIX 6.5


I have:

  picture.bind( "<ButtonPress-1>"  , click_cb )
  picture.bind( "<ButtonRelease-1>", click_cb )

In click_cb(), event.state is 0 for ButtonPress and 256 for ButtonRelease.

Where are the Tkinter constants for these?  Or how should one distinguish
between a press and release in a callback?

(I want to avoid having a separate callback for each type of event.)



====================================================================
Audit trail:
Thu Nov 18 10:42:46 1999	guido	changed notes
Thu Nov 18 10:42:46 1999	guido	moved from incoming to notabug
Thu Nov 18 14:07:59 1999	guido	changed notes
Thu Nov 18 14:07:59 1999	guido	moved from notabug to request

Follow-Ups:

Date: 2000-Aug-01 14:10
By: none

Comment:
From: Guido van Rossum <guido@CNRI.Reston.VA.US>
Subject: Re: [Python-bugs-list] Tkinter missing button state symbols (PR#132)
Date: Thu, 18 Nov 1999 10:41:31 -0500

> Full_Name: Randall Hopper
> Version: 1.5.2
> OS: IRIX 6.5
> Submission from: ethyl-f.rtpfddi.epa.gov (134.67.65.11)
> 
> 
> I have:
> 
>   picture.bind( "<ButtonPress-1>"  , click_cb )
>   picture.bind( "<ButtonRelease-1>", click_cb )
> 
> In click_cb(), event.state is 0 for ButtonPress and 256 for ButtonRelease.
> 
> Where are the Tkinter constants for these?  Or how should one distinguish
> between a press and release in a callback?
> 
> (I want to avoid having a separate callback for each type of event.)

This is not a question for the bugs list.

Write to help@python.org or use the newsgroup for help.  I don't know
offhand what the answer is to your question; I suspect that the answer
is in the Tcl/Tk man page for the bind command though.

--Guido van Rossum (home page: http://www.python.org/~guido/)

-------------------------------------------------------

Date: 2000-Aug-01 14:10
By: none

Comment:
From: Randall Hopper <Hopper.Randall@epa.gov>
Subject: Re: [Python-bugs-list] Tkinter missing button state symbols (PR#132)
Date: Thu, 18 Nov 1999 14:04:13 -0500

Guido van Rossum:
 |> Full_Name: Randall Hopper
 |> Version: 1.5.2
 |> OS: IRIX 6.5
 |> Submission from: ethyl-f.rtpfddi.epa.gov (134.67.65.11)
 |> 
 |> 
 |> I have:
 |> 
 |>   picture.bind( "<ButtonPress-1>"  , click_cb )
 |>   picture.bind( "<ButtonRelease-1>", click_cb )
 |> 
 |> In click_cb(), event.state is 0 for ButtonPress and 256 for ButtonRelease.
 |> 
 |> Where are the Tkinter constants for these?  Or how should one distinguish
 |> between a press and release in a callback?
 |> 
 |> (I want to avoid having a separate callback for each type of event.)
 |
 |This is not a question for the bugs list.
 |
 |Write to help@python.org or use the newsgroup for help.  I don't know
 |offhand what the answer is to your question; I suspect that the answer
 |is in the Tcl/Tk man page for the bind command though.

My fault.  I should have rephrased the question into a statement.  Tkinter
does not provide symbol defines for event.state values (%s keyword in Tcl).
Tcl doesn't either, but it would be useful if Tkinter did.

This is a small enhancement request rather than a hard bug, but I thought
the submission form was for probably applicable for both.

Thanks,

Randall

-------------------------------------------------------

Date: 2000-Aug-01 14:10
By: none

Comment:
From: Guido van Rossum <guido@CNRI.Reston.VA.US>
Subject: Re: [Python-bugs-list] Tkinter missing button state symbols (PR#132)
Date: Thu, 18 Nov 1999 14:05:57 -0500

Yes, requests are okay.  Sorry for the confusion.

--Guido van Rossum (home page: http://www.python.org/~guido/)

-------------------------------------------------------

Date: 2000-Aug-01 14:10
By: none

Comment:
Should add a symbol as he suggests.
-------------------------------------------------------

Date: 2000-Aug-09 02:21
By: effbot

Comment:
IIRC, these constants are platform (X library) dependent (they have to be exported from _tkinter.c, not Tkconstants.py).

I'll investigate.  Feel free to assign the bug to me if you like.

</F>
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=110823&group_id=5470