[haiku-development] Re: Hello, and a BBitmap question.

  • From: jkim202@xxxxxxxxxxxxxxxxx
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 6 Jun 2008 20:56:27 +1200

Yes, BControls are already part of a BWindow hierarchy.

As François suggested, I tried removing them from the window.

How exactly do you remove BView or BControl object from the window they belong

I tried calling BView::RemoveSelf(), BView::Invalidate(), BView::Flush(),
BView::DetachAll() but they don't seem to do what I expect.




Quoting François Revol <revol@xxxxxxx>:

> Hmm it depends where the BControls you want to draw are...
> That code supposes you create the BControls yourself and do bm->
> AddChild() on them.
> Are they already part of a BWindow hierarchy ?
> If so you cannot do that.
> Either temporarily remove them from the window they are in, attach them
> to the bitmap, draw, and put them back to the window, or use BPicture,
> like in Sudoku:
> You first force a draw on a BPicture object, without having to detach
> the object (means you don't reset anything it might have changed), then
> you draw the picture on a BView attached on a BPicture.
> François.

Other related posts: