Native GTK2 D Bindings

Artur Skawina art.08.09 at gmail.com
Mon Jan 23 05:43:24 PST 2012


On 01/23/12 05:14, Artur Skawina wrote:
> On 01/23/12 03:17, bearophile wrote:
>> This line of code seems an example for people that like named arguments in D:
>> gtk.init(null,null);
> 
> This has nothing to do with named arguments, it's gtk wanting to parse
> and modify the C argv[], which i didn't want to rebuild in these examples.
> /* void gtk_init(/*inout*/ int* argc, /*inout*/ char*** argv=null);*/
> 
> A function which handles the argv conversion both ways would be a good
> idea. On the list. Thanks.

Done. 

--- a/example_gtk2.d
+++ b/example_gtk2.d

 int main(string argv[]) {
-   gtk.init(null,null);
+   argv = gtk.init(argv);

Not only looks much better, now you can set the programs class and
name/resource, turn off/on the GTK builtin debugging etc.

And even some camelCase got in. :) (for the D-specific additions, not
the 1:1 mapped GTK API)

artur


More information about the Digitalmars-d mailing list