in reply to "spinners" in perl/tk

Thank you for the quick reply but I also have one more question about this, i'm trying to create a spinner that will allow the user to chose a time (00:00 - 23:59) but I can't seem to figure out how I can associate the 2.

also I tried this code:

use Tk; use Tk::SpinBox; my $mw = MainWindow->new; $mw->title("Spinner"); $mw->MainWindow->Frame(-relief=>'groove'); $mw->minsize(600,300); my $spin = $mw -> SpinBox()-> pack ( -anchor => 'nw'); MainLoop;
but it says:
Assuming 'require Tk::SpinBox;' at a.pl line 9
Failed to AUTOLOAD 'Tk::Widget::SpinBox' at a.pl line 9

and i've gone to my perl and perl lib folder and done:
ppm install Tk::SpinBox

any suggestions? :S

PS: I tried to make my message neater this time, I hope it's up to standards :)

Replies are listed 'Best First'.
Re^2: "spinners" in perl/tk
by castaway (Parson) on Nov 21, 2004 at 21:13 UTC
    Hmm, I have no Windows installation to check, but I guess its there somewhere. It should be in the standard Tk set of widgets. (It also appears to be inside another widget).

    Did you look at the widget example? In your case, you'll probably need to pass it a list of values for every minute between 00:00 and 23:59, using the -values attribute.

    my $spin = $mw->SpinBox(-values => ['00:00','00:01','00:02' .. ])-> pa +ck ( -anchor => 'nw');
    Or did you mean you want two spinboxes, one for hours and one for minutes? Then you'll have to set up callbacks for the -command attribute.

    PS: Please don't double post things, thanks.

    C.

Re^2: "spinners" in perl/tk
by pg (Canon) on Nov 21, 2004 at 22:07 UTC
    "Failed to AUTOLOAD 'Tk::Widget::SpinBox' at a.pl line 9"

    Spell SpinBox as Spinbox, a small b ;-)

      you probably have older version of Tk installed which doesn't contains Tk::SpinBox module. Try installing the latest version of Tk from CPAN.