Re: queue_draw_area query..

On 04/21/01 Paul Schulz wrote:
It runs and will update the screen on an expose events,
(resize, and moving a window in front..)
but doesn't update the display if I draw on the backing pixmap
(with update_chart).
sub expose_chart {
  my ($widget, $event ) = @_;

  my ( $event_area );

  $event_area = ${$event}{'area'};

I suggest using:
        my @event_area = @{$event->{'area'}};
and then reference the items as:
        $event_area[0], etc
to reduce line noise.


use Data::Dumper; print Dumper(\ _);


sub update_chart {
    my( $widget, $pos, $traffic ) = @_;
    my $blue_gc = new Gtk::Gdk::GC ( $widget->window );   

    print "$pos - $traffic\n";

    $widget->queue_draw_area ($margin+$pos, 

You are requesting the update of the wrong area: in Gtk/X coordinates
start from 0 at the top-left corner. Also, the prototype is

        $widget->queue_draw_area($x, $y, $width, $height);

Changing the code to read:

        $widget->queue_draw_area ($margin+$pos, 0, 1, $height);

makes it work.


No need to realize here.
$b = new Gtk::Button("Quit");
$b->signal_connect('clicked', sub {Gtk->exit(0)});


If you use show_all() on the toplevel widget it's not necessary to 
show the child widgets one at a time earlier...


lupus debian org                                     debian/rules
lupus ximian com                             Monkeys do it better

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