Tk Library Source Code

View Ticket
Login
Ticket UUID: 436762
Title: BWidget tree and listbox binding bug
Type: Bug Version: None
Submitter: bach Created on: 2001-06-27 16:23:21
Subsystem: bwidget Assigned To: damonc
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2003-10-21 06:16:44
Resolution: None Closed By: damonc
    Closed on: 2003-10-20 23:16:44
Description:
Version: BWidget CVS nightly from 21.06.2001

In BWidget version 1.2.1, the following code worked:

Tree .t 
bind .t <ButtonPress-3> {foo}
ListBox .l
bind .l <ButtonPress-3> {foo}

This doesn't work anymore. Looking through the CVS for
tree.tcl,
I saw that somewhere between tree Rev1.1 (from
BWidget-1.2.1) and tree Rev1.11 a change was made that
broke the above code.

Looking further, ericm tried out some fancy things in
tree Rev 1.27 that made it work again, but has undone
them in 1.28. (I suppose the same applies for
listbox.tcl).

I need that sort of things to get a popup menu on right
mouseclick in the whole tree (listbox) area, not just
when right-clicking on items or icons ( a la ".t
bindText" and ".t bindImage".

Any idea how to get this to work?

Salut,
       Bastien
User Comments: norganos added on 2002-01-09 15:17:47:
Logged In: YES 
user_id=418919

perhaps bind them to .tree.c or .list.c, the canvas itself? 
i just know, that i had something similar, that worked 
after i binded it to the canvas...

bach added on 2001-06-28 20:07:41:
Logged In: YES 
user_id=98533

Followup: a thread on clt gave this workaround (I've put a
feature request
at the bottom):

On Thu, 28 Jun 2001 09:17:19 GMT, Jos Decoster
<[email protected]> wrote:   
>The ListBox and Tree are drawn in a canvas. In the 1.2.1
release, this canvas  
>was create with the path-name you supplied. In the current
CVS release, first a
>frame is created with class ListBox or Tree (to better
handle option database  
>stuff) and in this frame a canvas is
packed:                                   
>[...]                                                                          
>You could try to
use:                                                          
>                                                                               
>       bind .t.c <ButtonPress-3>
{foo}                                         
>       bind .l.c <ButtonPress-3>
{bar}                                         

This works, put I'd prefer not to use BWidget internal
naming schemes.
So I'll request a new command for tree.tcl and listbox.tcl:

      .t getCanvas
      .l getCanvas

like the 'getFrame' command from panedwindow.tcl.

Salut,
        Bastien