[Gambas-devel] Early auto-instance

Benoît Minisini gambas at ...1...
Sat May 12 23:58:51 CEST 2012


Le 12/05/2012 23:46, tobi a écrit :
>
> I would go like this:
>
> - Window not auto-creatable, parent Screen is mandatory for Window constructor
> - Screen auto-creatable
>
> It means that the user will have to create a Window to paint on first in every gb.ncurses program.
> If I would make the parent parameter optional, I would have to use a default screen and then it
> would be the same issue as above, I would need the auto-instance of Screen for this...
>

You don't need an existing Gambas Screen object to refresh the screen.

You must make a split between the Screen class (which is an interface) 
and the real routines doing the job.

I mean: if Window.Print() needs a screen refreshing, then the 
Window.Print() implementation method will call an internal helper 
function that refreshes the screen.

The Screen.Refresh() method will call the same internal function. But a 
Window object should not depend on the existence of the Screen Gambas 
object.

Am I clear?

-- 
Benoît Minisini




More information about the Devel mailing list