[Gtk-sharp-list] Placing controls and sizing them
Mariano Benedettini
mbenedettini at ad-net.us
Mon Dec 19 13:17:06 EST 2005
Please check the widget packing theory in the Gtk+ tutorial:
http://www.gtk.org/tutorial/c374.html
Most of the gtk# functions are wrappers of the c functions that belongs
to gtk+, so the tutorial will give you a very good idea of how does this
stuff works.
Mariano.
Buddy Lindsey wrote:
> I have been trying to figure this out, but can you give a more detailed
> example of what the packstart does and when and how to use it. Being
> as new to gtksharp as i am i see it used quite a bit but don't
> understand it to well.
> --
> Buddy Lindsey
> http://www.buddylindsey.com
>
> On 12/19/05, *Mariano Benedettini* < mbenedettini at ad-net.us
> <mailto:mbenedettini at ad-net.us>> wrote:
>
> 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/monodoc.ashx?tlink=5@ecma%3a707%23Box%2fM%2fPackStart%2f3
> >>
> >>
> >> If you are using Glade, just uncheck the options at design time.
> >>
> >> Mariano.
> >
> >
> >
> > _______________________________________________
> > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com
> <mailto:Gtk-sharp-list at lists.ximian.com>
> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> >
> >
>
> _______________________________________________
> Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com
> <mailto:Gtk-sharp-list at lists.ximian.com>
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
More information about the Gtk-sharp-list
mailing list