#!/usr/local/bin/perl5.8.3 -w use lib '/cdb/omap4ExtSetup/ind/lib/site_perl/5.8.3/'; use strict; use English; use Tk::Wizard; my $wizard = new Tk::Wizard; my %ocp_description; # MASTER OR SLAVE selection print $wizard->addPage( sub { page_one($wizard)} ) , "\n"; ## READ OR WRITE print $wizard->addPage ( sub { page_two($wizard)}), "\n"; $wizard->Show; MainLoop; exit; sub page_one { my $wizard = shift; $wizard->{backButton}->configure(-state=>'disable'); $wizard->{nextButton}->configure(-state=>'disable'); my $frame = $wizard->blank_frame ( -title => "Master or Slave Interface", -text => "Please select the type of interface on your module", -borderwidth => 2, ); my $slave_cb = &add_check_button($frame,"slave"); my $master_cb = &add_check_button($frame,"master"); $master_cb->configure (-command => sub { if ($ocp_description{master} == 1) { $slave_cb->configure(-state => 'disabled'); $wizard->{nextButton}->configure(-state=>'active'); }else{ $slave_cb->configure(-state => 'active'); $wizard->{nextButton}->configure(-state=>'disable'); } }); $slave_cb->configure (-command => sub { if ($ocp_description{slave} == 1) { $master_cb->configure(-state => 'disabled'); $wizard->{nextButton}->configure(-state=>'active'); }else{ $master_cb->configure(-state => 'active'); $wizard->{nextButton}->configure(-state=>'disable'); } }); $master_cb->pack(); $slave_cb->pack(); } sub page_two { my $wizard = shift; my $frame = $wizard->blank_frame ( -title => "Read or write", -text => "Does your module support the following", -borderwidth => 2, ); my $read_cb = &add_check_button($frame,"read"); my $write_cb = &add_check_button($frame,"write"); my $writenonpost_enable_cb = &add_check_button($frame,"writenonpost_enable"); $write_cb->configure (-command => sub { if ($ocp_description{write} == 0) { $writenonpost_enable_cb->configure(-state => 'disabled'); }else{ $writenonpost_enable_cb->configure(-state => 'active'); } }); $read_cb->pack(); $write_cb->pack(); $writenonpost_enable_cb->pack(); } sub add_check_button { my $frame = shift; my $tag = shift; my $comment = shift; if (! defined $comment){ $comment = $tag; } my $cb = $frame->Checkbutton (-text => $comment, -variable => \$ocp_description{$tag}, ); return $cb; }