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
Replies are listed 'Best First'.
Re^2: Numeric entry Tk widget with up/down buttons, does it exist?
by perltux (Scribe) 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 drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2015-08-01 00:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls