simple display (from: GUI library for D)

Michel Fortin michel.fortin at michelf.com
Fri Apr 8 18:29:11 PDT 2011


On 2011-04-08 20:11:10 -0400, Adam D. Ruppe <destructionator at gmail.com> said:

> My only concern is I don't want Phobos to depend on Xlib unless
> the module is actually imported. I don't think it will be a problem,
> but if it means a hello world won't run on a text only machine, that
> won't be ok.

I'm concerned by this too.

I think you need two modules. One for images images with absolutely no 
dependencies, and another for everything dealing with windows. Only if 
you import the window module you need to link with the relevant 
libraries.

That means you'll need to change the image.display() shortcut to 
something else not a member of image. I don't think it's particularly 
good that images has such a member anyway, it'd be better as a 
standalone function in my opinion.

(Actually, perhaps we need a third to deal with drawing which might 
also be dependent on system libraries, especially if needs to draw 
text.)

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d mailing list