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

Need help with Dialog

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



Joined: 28 Dec 2008
Posts: 34

PostPosted: Fri Jul 24, 2009 9:37 pm    Post subject: Need help with Dialog Reply with quote

I can create a simple dialog with buttons but I can't figure out how to add a label and a input box to it. I tried using getContentArea and getActionArea but i keep getting access violation.

An example would help a lot.
Back to top
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Sat Jul 25, 2009 3:13 pm    Post subject: Reply with quote

This is working for me:

Code:
module gtk.DialogTest;

import gtk.Main;
import gtk.Label;
import gtk.Dialog;
import gtk.Button;
import gtk.Widget;
import gdk.Event;

void main(string[] args)
{
   void exit(Button btn)
   {
      Main.quit();
   }

   bool windowDelete(Event event, Widget widget)
   {
      Main.quit();
      return false;
   }

   Main.init(args);
   Dialog dlg = new Dialog();

   auto vbox = dlg.getContentArea();
   vbox.add(new Label("Hello World"));

   auto hbox = dlg.getActionArea();
   hbox.add(new Button(StockID.CLOSE, &exit));

   dlg.addOnDelete(&windowDelete);
   dlg.showAll();

   Main.run();
}
Back to top
View user's profile Send private message
mike



Joined: 28 Dec 2008
Posts: 34

PostPosted: Sat Jul 25, 2009 3:41 pm    Post subject: Reply with quote

Thanks for the example. I figured out that I was using the wrong dlls. Sad

Thanks Mike Wey.
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