Commit 59eeae9d authored by Ludovic Rousseau's avatar Ludovic Rousseau

gscriptor: save and restore the window size

Thanks to Lionel Victor for the patch.
parent 0179b121
......@@ -93,12 +93,10 @@ sub arrange_widgets () {
# create and bind scrollable areas for text view
$vscScript = Gtk3::ScrolledWindow->new;
$vscScript->set_size_request(200, 200);
$vscScript->set_policy ('automatic', 'automatic');
$vscScript->add($txtScript);
$vscResult = Gtk3::ScrolledWindow->new;
$vscResult->set_size_request(200, 200);
$vscResult->set_policy ('automatic', 'automatic');
$vscResult->add($txtResult);
......@@ -230,6 +228,7 @@ sub arrange_widgets () {
$rdbASCII->signal_connect('toggled', \&RefreshResult);
$rdbHex->signal_connect ('toggled', \&RefreshResult);
$wndMain->signal_connect ("delete_event", \&CloseAppWindow);
}
################# weave and show tha application main window #################
......@@ -366,15 +365,13 @@ sub ReadConfigFile {
print STDERR "Couldn't read from $strConfigFileName. Using default configuration\n";
}
$vscScript->set_size_request(split / /, $hConfig{'ScriptSize'}) if (defined $hConfig{'ScriptSize'});
$vscResult->set_size_request(split / /, $hConfig{'ResultSize'}) if (defined $hConfig{'ResultSize'});
$wndMain->set_default_size(split / /, $hConfig{'WindowSize'}) if (defined $hConfig{'WindowSize'});
}
sub WriteConfigFile {
my $strTmpKey;
$hConfig{'ScriptSize'} = join (" ", $vscScript->get_size_request());
$hConfig{'ResultSize'} = join (" ", $vscResult->get_size_request());
$hConfig{'WindowSize'} = join (" ", $wndMain->get_size());
die ("Can't open $strConfigFileName for writing: $!\n") unless (open (FILE, ">$strConfigFileName"));
print FILE "# This file is automatically generated\n# Do not edit unless you know what you are doing\n\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment