$settings = Win32::GUI::DialogBox->new( -name => 'Settings', -text => 'Configuration Settings', -pos => [ $x, $y ], -width => $dbWidth, -height => $dbHeight, -class => $icon_class, -parent => $Main, ); if (-e $CONFIG_FILE) { $settings->AddButton( -name => 'SettingsEdit', -text => 'Edit', -default => 0, # Give button darker border -width => 60, -height => 20, -left => $settings->ScaleWidth() - 280, -top => $settings->ScaleHeight() - 30, -tabstop => 1, # Allow tab navigation ); } if (-e $CONFIG_FILE) { $readOnlyFlag = 1 } else { $readOnlyFlag = 0 }; # Create Textfield for Edit Text $Settings_HomeDirTF = $settings->AddTextfield( -name => "Settings_homedir", -pos => [100, 30], -size => [200, 20], -multiline => 0, -hscroll => 0, -vscroll => 0, -autohscroll => 1, -autovscroll => 0, -keepselection => 1, -readonly => $readOnlyFlag, -tabstop => 1, # Allow tab navigation -prompt => "Home directory:", ); if (-e $CONFIG_FILE) { $stat = ReadConfigFile(); if ($stat == 0) { if (defined($HOMEDIR)) {$Settings_HomeDirTF->Text("$HOMEDIR"); } if (defined($CONSDIR)) {$Settings_ConsDirTF->Text("$CONSDIR"); } if (defined($MASTER_SS)) {$Settings_RefFileTF->Text("$MASTER_SS"); } #$Window->Textfield->Change(-readonly => 1); #$Settings_HomeDirTF->Change(-readonly => 1); } } sub SettingsEdit_Click { print "Edit_Click\n"; $Settings_HomeDirTF->Change( -readonly => 0); $Settings_ConsDirTF->Change( -readonly => 0); $Settings_RefFileTF->Change( -readonly => 0); $Settings_HomeDirTF->Update(); #UpdateWindow $Settings_ConsDirTF->Update(); $Settings_RefFileTF->Update(); return 0; }