Leser: 1
2 Einträge, 1 Seite |
1
2
3
4
5
6
my $delete_button_left = $frame_top_left->Button(-text => 'Delete selected Item',
-width=> 15,
-activebackground => "red",
-state => "disabled", #solange nix in der linken Listbox markiert ist, kann ich nicht auf diesen Button drücken
-command => \&delete_table_top_left )
->pack();
1
2
3
4
5
6
sub delete_table_top_left
{
$select_top_left = $listbox_top_left->curselection;
$select_top_left = $listbox_top_left->get($select_top_left);
$listbox_top_left->delete($listbox_top_left->curselection);
}
$delete_button_left->configure(-state => 'normal');
$delete_button_left->configure(-state => 'disabled');
Quote\n\nName: state
Class: State
Switch: -state
Specifies one of three states for the button: normal, active, or
disabled. In normal state the button is displayed using the
foreground and background options. The active state is typically
used when the pointer is over the button. In active state the button
is displayed using the activeForeground and activeBackground
options. Disabled state means that the button should be insensitive:
the default bindings will refuse to activate the widget and will
ignore mouse button presses. In this state the disabledForeground
and background options determine how the button is displayed.
2 Einträge, 1 Seite |