[Gtk-sharp-list] Placing controls and sizing them

Buddy Lindsey percent20 at gmail.com
Mon Dec 19 13:06:03 EST 2005


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> 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
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20051219/27f87be0/attachment.html


More information about the Gtk-sharp-list mailing list