Necessities for Adoption of D

bearophile bearophileHUGS at lycos.com
Sun Feb 10 04:47:00 PST 2008


Vladimir Panteleev:
> About GUI integration - I don't think it should be the burden of the language to provide that. There are several binding libraries for cross-platform GUI libraries which work pretty well (an example: http://wxd.sourceforge.net/ )

A built-in standard GUI toolkit has some advantages, it's a standard, so it hopefully gets developed to a refined state instead of having 5-10 half-baked GUI toolkits that are of little use, like the current situation. And if you don't like the standard one, you are free still to develop/install a different one.

Regarding WxD, I suggest their developers to take a good look at the now dead "Wax", it shows a way to write a better wrapper for Wx (it's not meant to replace the normal Wx API, but to offer an alternative, a simper one):
http://zephyrfalcon.org/labs/wax.html

Wax was developed for Python, that has named arguments too, so that Python code may look like:

tb = TextBox(parent, size=(400, 200), multiline=1, readonly=0, wrap=1, justify='left')

Named arguments are quite useful for such GUI-style code, but not available in D yet (they are in the D Wish List), so some alternative solution has to be found:

auto tb = TextBox(parent).size(400, 200).multiline(1).readonly(0).wrap(1).justify("left");

Or:

auto tb = TextBox(parent, ["nx":400, "ny":200, "multiline":1, "readonly":0, "wrap":1, "justify": LEFT]);

auto tb = TextBox(parent).opts(["nx":400, "ny":200, "multiline":1, "readonly":0, "wrap":1, "justify": LEFT]);

Bye,
bearophile



More information about the Digitalmars-d mailing list