Re: [gnomemm] Gnome::Canvas, Emergency !!



"gao chaowei" <chaoweigao hotmail com> writes:
> I drew something in a Gnome::Canvas. And I want to CLEAR the items
> canvas and want drawing somthing else. And I want DELETE the items in
> the canvas to save memary space. What should i do to achieve the
> goals? Wait for your response~

Like this:

  // create
  Gnome::Canvas::Pixbuf my_item = new ...;

  // now use the item ...

  // delete and clear
  delete my_item;

It is pretty simple. When you create the item with 'new' and don't tell
G*mm to treat it specially, you simple 'delete' it later to remove it
from memory, just as any other object. The canvas will automatically
redraw itself, clearing up.

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



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