GtkD button size

SaltySugar Saltysugar at inbox.lt
Tue Feb 5 11:48:37 PST 2013


On Tuesday, 5 February 2013 at 19:31:01 UTC, Mike Wey wrote:
> 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

Thank you, Mike. One more question. Can I use hbox.add(btn); 
instead of hbox.packStart (btn,false,false,5);
What difference between them?
Sorry, for my bad English.


More information about the Digitalmars-d-learn mailing list