for my $x (@structured_options) { $types_selected{$x}=0; my $structuredb = $structured_frame->new_ttk__checkbutton( -text => $x, -onvalue => 1, -offvalue => 0, -variable =>\$types_selected{$x}, ); $structuredb->g_pack(-side => "left"); } my $imagec = $image_frame->new_ttk__checkbutton( -text => 'All', -onvalue => 1, -offvalue => 0, -variable =>\$all_images, -command => sub{ select_all() }, ); $imagec->g_pack(-side => "left");