Daemons?

Deewiant deewiant.doesnotlike.spam at gmail.com
Wed Aug 15 03:55:56 PDT 2007


Daniel Swe wrote:
> I'm trying to make a GUI that can display both opengl windows and/or terminal
> windows (using ncurses). So one could start the program using a terminal
> (using ./test -console for example) at work. But later when I get home I
> would like a opengl window so I write ./test -opengl , and the same instance
> of the program that was used for the console would pop up with all the bells
> and whistles for opengl. The problem is that I don't really know how to do
> it. Should I make a daemon that guis connect to? Is there any way to find the
> pid and communicate with the instance using tango? Or is there another more
> clever way? I'm currently using gdc and Tango in Ubuntu.
> 

What's the problem? Just abstract out the user interface to a separate module
(or package, if it grows large enough) and instantiate a different type of
object depending on the command line. Or call a different set of functions, or
have a global enum which chooses between UIs, but I think the OO approach is
cleanest here.

-- 
Remove ".doesnotlike.spam" from the mail address.


More information about the Digitalmars-d-learn mailing list