ich habe bis jetzt ein riesen Skript (Tool mit GUI) geschrieben das fast fertig ist zu mindest für mich ist es riesig (1135 Zeilen). Der Chef hat gesagt wenn jemand noch was dazu schreiben will, dann muss man nicht das ganze Program ändern (Kostet Zeit und Geld)sondern einfach ein kleines Program schreiben im xml-file und somit das Tool soll immer prüfen ob das Wort Snippet im xml-file geschrieben ist und das Progrämchen ausführt.und zu 'select all'Button:
ich weiss nicht ob du mir hier helfen kannst?
das funktioniert jetz gut. aber nur für einen CheckboxFenster und nicht für die anderen auch. weil es 5 bei mir sind
hier hast du mein code kannst du mir bitte sagen was ich falsch mache?
am ende kriege ich so einen Fehler wenn ich auf "select all" klicke das in das 2te,3te,4te und 5te Checkboxfenster.beim 1sten checkboxfenster funktioniert das optimal:
Fehler:
Tk::Error: Can't call method "select" on an undefined value at Install_Platform_V1.0.pl line 1111.
[\&main::__ANON__]
Tk callback for .toplevel.frame.button1
Tk::__ANON__ at C:/Win16App/Perl/site/lib/Tk.pm line 217
Tk::Button::butUp at C:/Win16App/Perl/site/lib/Tk/Button.pm line 111
(command bound to event)
mein Code ist:
sub do_top($)
{
my @node_values;
my $button = shift; # input
my @check_value = {};
my (@program, $f_check, @pa);
my ($j, $i);
my ($exit, $select_all);
$continue = 0;
$exit_state = $continue;
$exits = 1;
$problem = 2;
if (! Exists($tl))
{ # checkFrame
@node_values = {};
$j = 0;
$tl = $mw->Toplevel;
$f_check = $tl->Frame(-relief => 'sunken', -borderwidth => '1m');
@pa = mark_children('Platform', 'Program', $button);
for($i=0; $i<$count_program; $i++)
{
if ($pa[$i]== 1)
{
@node_values = StandLib::GetALLNodeValues('Program',$i);
$check_value[$i]= 0;
#---checkbuttons---
$program[$i] = $f_check->Checkbutton(-text => $node_values[1],
-variable => \$checked_progs[$i])
->pack(-side => 'top', -anchor => 'w', -padx => '1c');
}
}
#---done_Button im Checkframe---
$exit = $f_check->Button(-text => "done",
-command => sub{$tl->destroy})
->pack(-side => 'top', -padx => '0.5c');
$f_check->pack;
#---select_all_Button - Checkframe---
$select_all = $f_check->Button( -text => "select all",
-command => sub{&check_all(@program);})
->pack(-side => 'top', -padx => '0.5c');
$f_check->pack;
$select_all->bind =>('<ButtonPress>'=> \&check_all);
}
else
{
$tl->deiconify;
$tl->raise ; # ignore Exceptions
}
return $exit_state
}# sub do_top
sub check_all(@)
{
my (@program) = @_;
my $checkbox;
for $checkbox (@program)
{
$checkbox->select();
}
Datum: 04.06.2007-10:02
