Thread Feldfarbe von BrowseEntry mit readonly (4 answers)
Opened by Herr_Cisie at 2006-04-13 15:19

Matze
 2006-04-13 19:42
#45347 #45347
User since
2005-08-29
222 Artikel
BenutzerIn
[Homepage] [default_avatar]
Also, du musst auch noch die Funktion state() aufrufen.
Zuerst solltest du aber in BrowseEntry.pm folgende veränderungen vornehmen:

In der subroutine _set_edit_state:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
    if ($w->cget( '-colorstate' )) {
my $color;
if( $state eq 'normal' ) {                  # Editable
   $color = '#ffffff';
} else {                                    # Not Editable
   $color = $w->cget( -background ) || 'lightgray';
}

# $entry->Subwidget( 'entry' )->configure( -background => $color );
$entry->configure( -background => $color );
   }


Danach, der Aufruf in deimen Skript:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
my @arr = qw(Hallo sie da !!!!);

$be = $mw -> BrowseEntry
(-background => "white",
-label => "Test:",
-command => "exit",
-state => "readonly",
-colorstate => "normal",
-choices => \@arr)->pack
(-pady => 10,
-padx => 10);

$be -> state ("normal");


So sollte es funktionieren.

MfG. Matze
Mit freundlichen Grüßen: Matze

View full thread Feldfarbe von BrowseEntry mit readonly