binding mouse clicks to Tk::Columns 
Author Message
 binding mouse clicks to Tk::Columns
Hi all,

Is there a way to bind mouse clicks with the Tk::Columns widget as in the
example below(doesn't work by the way)? I need to take separate actions
depending on whether there was a single or double click.

Larry S.


$runid_list = $runid_list_frame->Columns
(


-listforeground => 'blue',
-listbackground => 'white',
-selectmode => 'extended',
-sort => 'true',
)->pack(
-fill => 'both',
-padx => 5,
-pady => 5,
);

# When a qual name is selected update $qual_name
$runid_list->bind( '<1>' => \&update_runid_name);
# Display the record upon receiving a double click
$runid_list->bind( '<Double-1>' => \&display_config);



Sat, 03 Jan 2004 00:02:52 GMT  
 binding mouse clicks to Tk::Columns

Quote:
>Is there a way to bind mouse clicks with the Tk::Columns widget as in the
>example below(doesn't work by the way)? I need to take separate actions
>depending on whether there was a single or double click.

Well, you could always pull out each listbox and bind
to them individual. That should work.

Something like:

foreach my $lb ($l_Columns->lists) {
  $lb->bind('<ButtonPress-1>', \&someFunction );

Quote:
}

Rob


Sat, 03 Jan 2004 00:29:15 GMT  
 binding mouse clicks to Tk::Columns

Quote:
> Well, you could always pull out each listbox and bind
> to them individual. That should work.

> Something like:

> foreach my $lb ($l_Columns->lists) {
>   $lb->bind('<ButtonPress-1>', \&someFunction );

Rob,

This kinda works. I had no idea I could create a binding on a list element
in this way. There is a problem though. I can only get a single mouse click
to bind but not a double (<Double-1>).

Larry S.



Sat, 03 Jan 2004 22:37:42 GMT  
 binding mouse clicks to Tk::Columns

Quote:
> This kinda works. I had no idea I could create a binding on a list element
> in this way. There is a problem though. I can only get a single mouse
click
> to bind but not a double (<Double-1>).

Well, I was able to get a double mouse click working like so:
$row->bind('<Button-1><ButtonRelease-1><Button-1><ButtonRelease-1>' =>
ub{ popup_msg("Double click")});

but I still can't get the double click and the single click bindings to
coexist.

Larry S.



Sat, 03 Jan 2004 23:13:24 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Mouse Click Bind for an Entry Widget

2. Please help: Binding mouse click to tree entry.

3. binding right mouse button click to all buttons

4. Tk::Columns ans single-click

5. Binding right mouse button for Tk::Tree items

6. simulating a mouse click?

7. Sending keystrokes and mouse click under WinPerl

8. anyone know how to simulate a mouse click?

9. Mouse click location on a scrolled canvas

10. Simulating mouse clicks on other GUI programs

11. left mouse click on HList throws messages when empty

12. A weird one - misguided mouse clicks and all that

 

 
Powered by phpBB® Forum Software