You should use Boxes. Here's go a working example, a modified version of
the one found in http://www.mono-project.com/GtkSharpBeginnersGuide :
using System;
using Gtk;
public class GtkHelloWorld {
public static void Main() {
Application.Init();
//Create the Window
Window myWin = new Window("My first GTK# Application! ");
myWin.Resize(200,200);
Button myButton = new Gtk.Button("Example button");
VBox myVBox = new VBox();
HBox myHBox = new HBox();
myHBox.PackStart(myButton, false, false, 5);
myVBox.PackStart(myHBox, false, false, 0);
myWin.Add(myVBox);
//Show Everything
myWin.ShowAll();
Application.Run();
}
}
John Meyer wrote:
All right, but I can't use PackStart from the window.
Here's my code
public MyWindow () : base ("MyWindow")
{
this.SetDefaultSize (400, 300);
Button btn = new Button("Click me");
btn.Clicked += new EventHandler(btn_click);
btn.SetSizeRequest(50,50);
this.Add(btn);
Mariano Benedettini wrote:
See the fill and expand properties:
http://www.go-mono.com/docs/[EMAIL PROTECTED]
If you are using Glade, just uncheck the options at design time.
Mariano.
_______________________________________________
Gtk-sharp-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
_______________________________________________
Gtk-sharp-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list