Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

A click and hold button

by Anonymous Monk
on Jul 31, 2013 at 07:34 UTC ( #1047191=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello wise monks, I a seek your wisdom: does any one have an example of a button that when clicked upon initiates a command, and when you click and hold pops up a menu. Something like Optionsmenu but with the single click and click and hold distinction. Thanks

Replies are listed 'Best First'.
Re: A click and hold button (Tk::bind clickon clickoff)
by Anonymous Monk on Jul 31, 2013 at 07:46 UTC

    that is any button where you use Tk::bind to bind clickon and clickoff, and in clickon you start a button timer

    if clickoff fires before timer expires, then you run one

    if timer expires before clickoff fires, you run two

    clickon is called a press and clickoff is called a release tk bind button click press release

      Thanks. I played with the timers a bit, but I'm still missing on how to create the pop-up menu bellow the button.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1047191]
Approved by Corion
[Discipulus]: no, they are my crossword/sudoku like entertainment
Discipulus grins
[marto]: Even with shell command recall I find it less time consuming to do such things in a file.
[marto]: I very seldom use one liners for anything which isn't utterly trivial
[Discipulus]: i'm wise enough to never use my oneliners

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2017-09-22 08:30 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (260 votes). Check out past polls.