gtkD GUI design

SaltySugar Butkustomas777 at gmail.com
Thu Jan 31 03:38:41 PST 2013


I want to do a GUI like this:
http://www.part.lt/img/f44e209eb2ccbc9dda2e6b11fa5c6317747.jpg

But I've got the following result:
http://www.part.lt/img/f4a238595048be7c23655b02477aabd8447.jpg

My Code:


import gtk.MainWindow;
import gtk.Label;
import gtk.Button;
import gtk.VBox;
import gtk.HBox;
import gtk.Entry;
import gtk.Main;

class Application : MainWindow
{
	this()
	{
		super("GtkD App");
		setDefaultSize(200, 200);
		
		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();
	}
}
void main(string[] args)
{
	Main.init(args);
	new Application();
	Main.run();
}

Thanks.


More information about the Digitalmars-d-learn mailing list