Could Tk be D's ideal widget set?

Jeff psychobrat at gmail.com
Mon Oct 9 00:57:22 PDT 2006


> I think a GUI for D should be written with D in mind from the start.
> I didn't look at tk/tcl/whatever-it-is-called, but just when you say 
> that it's written in C, this says to me it's not what D should adopt as 
> an official gui library.
> 
> Having said that, I'm personally of the opinion that Harmonia is the GUI 
> library that has the most potential.

I agree; I can understand that people want GUI libraries for D available 
as soon as possible, and indeed there are people working on such 
projects (i.e. D bindings, ports and/or OO abstractions for existing 
toolkits). However, if we really want some thing /good/ and maintainable 
that can really take advantage of D's features, then starting from 
scratch seems like the best path to me.

Even if progress was to be fairly slow, surely I'm not the only one who 
would be enthused enough by such a project to maintain interest? 
Remember, this wouldn't rule out using other toolkits in the meantime, 
but could also provide us with a /really/ good one in the long run.

For anyone interested, the (utopian? <g>) vision I've had in my mind for 
some time of a fresh D windowing toolkit would be:

- Minimal use of native windows/widgets (only for top-level, and other 
cases where really needed?); a Swing-esque approach could be taken to 
native look and feel (making it "somebody else's job"); stops the 
responsibilities getting too tangled, and it seems to have worked pretty 
well for them.
- Well-defined basic components that everyone expects (all the buttons, 
menus, etc.) but also /eventually/ packages containing more complex 
components (e.g. pretty message dialogs with cleanly expandable "more 
info" sections, headers and footers; colour, date selection dialogs; 
etc.). Saving people from recreating common widgets (formatted text 
areas) could really set it apart from the rest, and people not working 
on the core architecture of the library could certainly lend a hand here.
- Developed along-side the D standard library which will no doubt (?) be 
getting a lot more attention once v1.0 of the D spec is out.
- It would be nice if it could take advantage of existing cross-platform 
libraries where possible (e.g. pango for advanced text rendering, etc.), 
but maybe not too practical?
- Drawing inspiration from Swing, SWT, GTK(gtkmm), QT and other 
toolkits, whilst noting what design traps can be avoided due to D's 
language features.
- The will to Do It Right, no matter how long it takes. We should be in 
this for the long haul.

Does anyone else think it would be worth it, or are most people content 
to try to tap into existing toolkits through D?



More information about the Digitalmars-d mailing list