Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Numeric entry Tk widget with up/down buttons, does it exist?

by zentara (Archbishop)
on Nov 11, 2012 at 10:18 UTC ( #1003322=note: print w/ replies, xml ) Need Help??


in reply to Numeric entry Tk widget with up/down buttons, does it exist?

Here is a basic Spinbox example.

#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::Spinbox; #see also JComboBox my $mw = MainWindow->new; $mw->title("Spinner"); $mw->fontCreate('big', -family=>'courier', -weight=>'bold', -size=> 24); my $sp1 = $mw->Spinbox(-width => 2, -font => 'big', -command => sub{ &show_set }, -value => [0..23])->pack (-side=>'left'); $mw->Label(-text=>":")->pack (-side=>'left'); my $sp2 = $mw->Spinbox(-width => 2, -font => 'big', -command => sub{ &show_set }, -value => [0..59])->pack (-side=>'left'); MainLoop; ########################### sub show_set{ print "@_\n"; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh


Comment on Re: Numeric entry Tk widget with up/down buttons, does it exist?
Download Code
Re^2: Numeric entry Tk widget with up/down buttons, does it exist?
by perltux (Beadle) on Nov 19, 2012 at 09:55 UTC
    Thanks, after checking out both NumEntry and Spinbox I chose Spinbox as it seems the better one (at least for my specific use-case).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003322]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-09-20 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls