A) How can I react to the resizing of my main window?
Something like
{{{
$mw->bind('<ResizeRequest>', sub {
print "Resize\n";
});
}}}
doesn't seem to work.
B) I don't really understand the format of the Events. How to I
code KeyPresses of '+' and '-'?
Regards,
Oliver
Not sure what ResizeRequest means, but you are right - it doesn't
activate if the user resizes the window.
You can bind '<Configure>' and then filter out changes that don't
affect the size.
> B) I don't really understand the format of the Events. How to I
> code KeyPresses of '+' and '-'?
>
Really you're only allowed 1 question per post, but we'll
give you a pass this time.
sub WutKey {
my ($self, $key) = @_;
print "Release to $key\n";
}
$Mainwin -> bind('all', "<KeyRelease>" => [\&WutKey, Tk::Ev('K')]);
My keyboard reports 'plus' over 'equal' and 'Kp_add' in the number pad.
So if you want to capture shift-'=' then do
$Mainwin -> bind('all', "<KeyRelease-plus>" => [\&WutKey, Tk::Ev('K')]);
For me binding to <Configure> works. (But this is also called several
times at startup and at least twice during a resize)