dflplot/Plot2Kill, Most Mature *nix GUI For D2

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Fri Jul 16 00:52:35 PDT 2010


On Fri, 16 Jul 2010 02:41:01 +0000, dsimcha wrote:

> I've refactored my dflplot lib to the point where the GUI-specific stuff
> is well abstracted from the GUI-agnostic stuff in preparation for a port
> to a GUI lib that supports rotated fonts, saving bitmaps, and/or *nix. 
> The plan is to support multiple GUI libs, including DFL (already working
> except for rotated fonts and saving) and at least one or two more.
> 
> I started trying to do a port to gtkD, but found the API to be
> intolerable in that it's poorly documented and requires you to use the
> low-level C APIs (read:  raw pointers and
> functions_named_like_this_to_prevent_naming_collisions()) for basic
> stuff like constructing a drawing context.

Are you sure?  I admit, I have only played around with it, and never 
actually used it for serious work, but I never ran across any C-style 
interfaces while doing so.

gtkD seems to be modeled on GTK++, and its documentation comments seem to 
be copied verbatim from the GTK++ docs.  So if you're looking for very 
basic documentation (i.e. what does what?), this could be a good starting 
point:

  http://library.gnome.org/devel/gtk/stable/

That said, could this be what you need?

  http://www.dsource.org/projects/gtkd/browser/trunk/src/gtk/DrawingArea.d


> [...]
> 
> OTOH, I realize that much, possibly the majority, of the D community, is
> *nix users and my plotting lib is useless to them as long as it's DFL
> only.  I also want to be able to create plots on some *nix machines I
> SSH into.  Therefore, I want to get a *nix port working in the near
> future.  What is the most mature GUI lib for D2 that supports *nix?  By
> mature, I mean:
> 
> 1.  Any low-level C APIs are well wrapped in nice D OO APIs to the point
> where you don't need to use the C APIs at least in the common cases.
> 
> 2.  It compiles out of the box on 2.047.
> 
> 3.  Preferably the documentation is decent, though I got by without this
> for the original DFL version.

The wxD library hasn't been updated for a year or so, but at that time it 
did work with D2.  Perhaps you could check with the authors just how much 
work it would take to bring it up to date with the latest DMD?

  http://wxd.sourceforge.net/

As an added bonus, wxWidgets is available for all platforms, so by using 
wxD you wouldn't have to do the GUI abstraction yourself.

BTW, gnuplot uses wxWidgets, so it's definitely usable for plotting.


> Also, I've tentatively named the multiple GUI lib version of this
> plotting lib Plot2Kill.  Is this reasonable, or do we want to keep the
> names of our scientific libs more boring and politically correct?

I see no reason why scientific libs should have more boring names than 
other libs.  Besides, I think the world is ready for a D library that 
doesn't have a 'D' in its name. ;)

-Lars


More information about the Digitalmars-d mailing list