Synchronizing two Paned widgets



I am running into a funny problem. I have two HPaned widgets and I
want to synchronize their handles. When the user moves one, I want the
other to move along. The way I achieve this is to call_back on the
'notify::position' event and then do
$a->set_position($b->get_position). However, this will result in an
infinite loop because the two widgets will keep changing each others
position and executing the callback forever.

Attaching a code sample. With this code, I can drag the top Hpaned and
the bottom one will follow along but NOT vice versa. If you uncomment
line 23, it'll go into a loop.

What is a clean way to achieve what I'm looking for ? I played with
some on_focus etc but not much success.

Ofey.

Attachment: paned.pl
Description: Perl program



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]