GtkD button size

Mike Wey mike-wey at example.com
Tue Feb 5 11:33:14 PST 2013


On 02/05/2013 06:33 PM, SaltySugar wrote:
> I can't find any tutorials about buttonboxes. Can you write how to use it?

Here is a small example:

import gtk.MainWindow;
import gtk.Button;
import gtk.Main;
import gtk.HButtonBox;

class Application : MainWindow
{
     this()
     {
         super("GtkD App");
         setDefaultSize(200, 200);

         HButtonBox hBox = new HButtonBox();

         Button btnLog = new Button("Login");
		btnLog.setSizeRequest (70, 50);
         hBox.packStart(btnLog, false, false, 3);

         add(hBox);
         showAll();
     }
}

void main(string[] args)
{
     Main.init(args);
     new Application();
     Main.run();
}

It looks like this:
http://i45.tinypic.com/msivb4.png

-- 
Mike Wey


More information about the Digitalmars-d-learn mailing list