Re: Adding items to tables



On Sun, 2008-09-14 at 19:56 +0100, Damon Chaplin wrote:
> On Sun, 2008-09-14 at 20:22 +1000, Richard Gipps wrote:
> > Hi all,
> >           I have been working on some code which adds items to tables 
> > when a particular event occurs. The problem is that when I add items to 
> > the table using say a button push, the items are not drawn on the canvas 
> > until I re-size it. I have tried using  goo_canvas_update(canvas) but 
> > that does not seem to do the trick. Is there another function I should 
> > be using? I have included some sample code to put the question into 
> > context. Note that I have no problem adding these items when not using 
> > events i.e. before gtk_main() is called.
> 
> I can reproduce that. It looks like the items are updated properly, but
> not redrawn.
> 
> A quick workaround is to force a redraw of the entire canvas:
> 
>     gdk_window_invalidate_rect (GOO_CANVAS (canvas)->canvas_window,
>                                 NULL, FALSE);

Actually this is probably a better workaround:
  gtk_widget_queue_draw (canvas);


It looks like I just forgot to request redraws of the items in the
layout code. It's a simple fix, I think.

Damon




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