> From my understanding BringWindowToTop is for Windows
> not objects on a window.
I must admit that I suspected the same, but since it works so nicely (see
snippet below), I figured it should do what I want (Perl spoiled me with
it's "do what I mean" capability). By the way, there's SetForegroundWindow()
which does pretty much the same thing.

This code shows overlapping buttons that bring themselves to top when
clicked. If you uncomment the Hide()s, things start developing a mind of
their own. Add another object so that each covers part of the others and try
to make sense of what happens ... a nice solitaire ... note that you can
click a button on a spot that is covered!

=snip=============================
$main->AddButton
(
        -name => 'knopf0',
        -text => 'knopf0',
        -pos  => [200, 200],
        -size => [70, 25],
);
sub knopf0_Click
{
#       $main->knopf0->Hide();
        $main->knopf0->Show();
        $main->knopf0->BringWindowToTop ();
}
$main->AddButton
(
        -name => 'knopf1',
        -text => 'knopf1',
        -pos  => [225, 210],
        -size => [70, 25],
);
sub knopf1_Click
{
#       $main->knopf1->Hide();
        $main->knopf1->Show();
        $main->knopf1->BringWindowToTop ();
}

Reply via email to