gtkD GUI design
SaltySugar
Butkustomas777 at gmail.com
Thu Jan 31 04:35:43 PST 2013
On Thursday, 31 January 2013 at 12:21:55 UTC, FG wrote:
> On 2013-01-31 12:38, SaltySugar wrote:
>>
>> HBox hBox = new HBox(false, 3);
>> HBox hBox1 = new HBox(false, 3);
>> VBox vBox = new VBox(false, 5);
>>
>> Button btnLog = new Button("LOGIN --->");
>> Label lblNick = new Label("User: ");
>> Entry txtNick = new Entry();
>> Label lblPass = new Label("Password: ");
>> Entry txtPass = new Entry();
>>
>> btnLog.setSizeRequest(70, 30);
>> vBox.packStart(hBox, true, true, 3);
>> vBox.packStart(hBox1, true, true, 3);
>>
>> hBox.add (lblNick);
>> hBox.add (txtNick);
>> hBox1.add (lblPass);
>> hBox1.add (txtPass);
>> vBox.add (btnLog);
>>
>> add(vBox);
>> showAll();
>
> You'd need vBox.setBorderWidth(8) or similar to add space
> around window borders and to keep the button from taking up all
> available width I think you will have to put btnLog inside a
> HBox first and then add that HBox to the vBox.
>
> (haven't checked any of this myself)
Thanks, setBorderWidth() is working but button's size isn't
changing.
More information about the Digitalmars-d-learn
mailing list