#!/usr/bin/perl -w # $Id: buttonbox,v 1.2 2002/07/27 20:11:17 tom Exp $ # # Purpose: # To demonstrate the Perl5 Cdk Buttonbox Widget. # # Initialize Cdk. # use Cdk; Cdk::init(); # Create the buttonbox buttons. my @buttons = ("Button 0", "Button 1", "Button 2", "Button 3"); # Create the buttonbox object. my $buttonbox = new Cdk::Buttonbox ( 'Buttons' => \@buttons, 'Height' => 1, 'Width' => 50, 'Cols' => 4, 'Rows' => 1); # Activate the object. my $button = $buttonbox->activate(); # Check the results. if (!defined $button) { popupLabel (["Escape hit. No button selected."]); } else { popupLabel (["You selected button $button"]); } # Exit Cdk. Cdk::end();