dflplot/Plot2Kill, Most Mature *nix GUI For D2

dsimcha dsimcha at yahoo.com
Fri Jul 16 06:34:08 PDT 2010


== Quote from Lars T. Kyllingstad (public at kyllingen.NOSPAMnet)'s article
> 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
> > [...]
> >

What turned me off was the Drawable class, which I'd be using heavily.  There's no
way to construct it w/o explicitly creating a pointer to a C struct and then
passing it in.  See

http://www.dsource.org/projects/gtkd/browser/trunk/src/gdk/Drawable.d

Also, only the SVN version compiles on 2.047, not any releases.  Again, I'm not
knocking gtkD's long-term viability.  I'm just saying it needs more time to mature.

On the other hand, the more you encourage me to look at it, the more I think that
the omission of any "real" c'tor for Drawable is a single oversight rather than a
general trend.  Initially I had decided that I was simply unwilling to mess w/ any
crufty C APIs to create this plotting library, but if I have to do it in one small
place to work around this omission, then I'll do it.

> > 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.

The GUI abstraction was actually fairly easy b/c only a very small portion of the
GUI stuff is used for plotting.  It would be nice if people could use my lib no
matter what GUI toolkit they prefer.  Also, gtkD works on Windows.


More information about the Digitalmars-d mailing list