Re: Window (CList) update semantics
- From: Tom Jennings <tomj wps com>
- To: Chas Owens <alas widomaker com>
- Cc: Gtk-Perl-MailingList <gtk-perl-list gnome org>
- Subject: Re: Window (CList) update semantics
- Date: Thu, 2 Jan 2003 14:08:43 -0800 (PST)
The window doesn't update until the handler returns.
Perl is not multi-threaded (at least not by default). This means that
nothing can happen until the handler returns or you code for it to
happen. I have found that saying
Gtk->main_iteration while Gtk->event_pending;
solves this sort of problem.
Thanks! I'm now using Gtk-> main_iteration_do (0) within the
routine that needs the screen update done; with a bunch of
functinos queued up it seems to flush them all OK.
sub update_cell {
my ($widget, $row, $col, $msg)= @_;
$widget-> select_row ($row, $col); # select the row,
$widget-> moveto ($row, 0, 0.5, 0.0); # center the list row,
$widget-> freeze;
$widget-> set_text ($row, $col, $msg); # new text,
$widget-> thaw;
Gtk-> main_iteration_do (0); # allow update now.
}
I'd bet under the circumstances the freeze/thaw aren't required,
but they don't hurt.
Thanks again (and thanks Muppet also).
tomj
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]