[Gambas-user] DrawingArea problems

Benoit Minisini gambas at ...1...
Tue Oct 10 19:41:52 CEST 2006


On Tuesday 10 October 2006 19:20, Christopher Brian Jack wrote:
> Is there a glitch with drawing to DrawingAreas?
>
> My former code to use a backbuffer:
>
> ========== 8x ==================================
>
> private backBuffer as Picture
>
> public sub Form_Open()
>   '...
>   backBuffer=new Picture(640,480,FALSE)
>   '...
> End
>
> public sub Render()
>   Draw.Begin(GfxArea)  'GfxArea is a DrawingArea
>   Draw.Picture(backBuffer,0,0,0,0,640,480) 'buckBuffer is a Picture
>   Draw.End()
>   'Blank back buffer
>   Draw.Begin(backBuffer)
>   FillRect(0,0,640,480,&H000000&)
>   Draw.End()
> End
>
> ========== 8x ==================================
>
> Is not drawing to the DrawingArea any more.  Is there a semantic that
> changed that makes this so it has to be done differently or is something
> in 1.9.44 broken thus causing this...?
>

This won't work if you don't set the Drawing.Cached property.

Anyway, what you want to do is what is already done by the Drawing.Cached 
property. Unless you need the back buffer for doing something other than 
drawing on it...

> Also my other form elements seem to want to go into the background with
> the DrawingArea in front but not accepting event focus.  I tried adding a
> GfxArea.SetFocus() to the Form_Open code but to no avail (still starts up
> in front without event focus until I explicitly click on it with the
> mouse).  

Use the hierarchy window to know the control focus order.

> I also haven't been able to properly get the other form elements 
> to show in front (of other windows/forms) but behind the DrawingArea
> control of the form.

???? I don't understand what you are talking about.

>
> ---PS---
> Yes I fixed almost all the compile problems but I gave up on getting
> Firebird support to work.  

Did you try what I asked you to try ?

> Ultimately once I debug the AI technology in my 
> game I'll be able to use sqlite or (g)dbm (non-server DB drivers) to hold
> the AI knowledge base.  Right now I need to be able to snoop on it while
> the game is live which is what makes a live SQL server a good idea for the
> time being.

Regards,

-- 
Benoit Minisini





More information about the User mailing list