SkipHuffman has asked for the wisdom of the Perl Monks concerning the following question:
I am really confused by this. I need an interface with some fields read only (labels) and some editable (data). I cannot seem to prevent editablity. I have tried two things that I think should work, this:
$Cell[1] = { CellType => "ROText", Row => 0, Col => 0, Contents => "Bank\\Branch\\Dept:" }; $Cell[2] = { CellType => "ROText", Row => 1, Col => 0, Contents => "Requestor:" }; foreach (1 .. $#Cell) { if (${$Cell[$_]}{'CellType'} == "Text") { $cell = $grid->Text( -width => 17, -height => 1, )->grid( -row => ${$Cell[$_]}{'Row'}, -sticky => "nsew", -column => ${$Cell[$_]}{'Col'}, ); } elsif (${$Cell[$_]}{'CellType'} == "ROText") { $cell = $grid->ROText( -width => 17, -height => 1, )->grid( -row => ${$Cell[$_]}{'Row'}, -sticky => "nsew", -column => ${$Cell[$_]}{'Col'}, ); }; $cell->Contents("${$Cell[$_]}{'Contents'}"); };
And this:
foreach (1 .. $#Cell) { if (${$Cell[$_]}{'CellType'} == "Text") { $cell = $grid->Text( -width => 17, -height => 1, -state =>'normal', )->grid( -row => ${$Cell[$_]}{'Row'}, -column => ${$Cell[$_]}{'Col'}, ); } elsif (${$Cell[$_]}{'CellType'} == "ROText") { $cell = $grid->Text( -width => 17, -height => 1, -state =>'disabled', )->grid( -row => ${$Cell[$_]}{'Row'}, -column => ${$Cell[$_]}{'Col'}, ); }; $cell->Contents("${$Cell[$_]}{'Contents'}"); };
Both of these result in fields that can be clicked on and edited.
What am I doing wrong?
|
|---|