FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

the next Hello World

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Sat Feb 18, 2006 2:57 am    Post subject: the next Hello World Reply with quote

Duit (the DUI replacement) can now compile and run a hello world. Very Happy
(no event or signals yet)

Code:

// the minimalistic version
module gtk.HelloWorld;

private import gtk.Window;
private import gtk.Label;
private import gtk.Duit;

void main(char[][] args)
{
   Duit.init(args);
   with (new Window("Duit"))
   {
      add(new Label("Hello World"));
      setBorderWidth(10);
      showAll();
   }
   Duit.main();
}


changes from DUI:
- new class Duit replaces DUI
- Duit is a class with static methods, not a singleton
(this might change as multiple main loops are allowed by Gtk and so we migh need multiple instances of Duit)
- Duit.init replaces DUI.dui
- Duit.main replaces dui.go
- Widgets are not shown by default - use showAll() on the container
- package names follow Gtk+ lib names

these changes make Duit more similar to Gtk without compromising the ease of use.

next to code:
- properties and style properties (never fully supported on DUI Wink)
Ant
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sat Feb 18, 2006 1:14 pm    Post subject: Reply with quote

Those look like great improvements, Ant. Keep up the good work! Smile

-JJR
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group