Hi Chris, can you please tell me what i'm doing wrong i'm using monodevelop RC1

//create a page with a textview widget
        protected virtual void onclicked (object sender, System.EventArgs e)
        {
                string label = "Hex File";
                
                HBox hbox = new HBox();
                
                hbox.PackStart(new Label(label));

                Button close = new Button("X"); // Set this up with an image or 
whatever.
                
                close.Relief = ReliefStyle.None;
                
                close.FocusOnClick = false;
                
                close.Clicked += delegate {
                        hbox.Destroy();
                        textview.Destroy();
                };
                
                hbox.PackStart(close);

                hbox.ShowAll();

                notebook1.AppendPage(textview, hbox);
                notebook1.ShowAll();
                
        }

On Sun, Feb 24, 2008 at 6:08 AM, Chris Howie <[EMAIL PROTECTED]> wrote:
>
> On Sat, Feb 23, 2008 at 7:36 PM, Darwin Reynoso <[EMAIL PROTECTED]> wrote:
>  > Hi,
>  >  how do i add a close button widget to a notebook page kind of like
>  >  monodevelop tabs.
>  >
>  >  here is my code
>  >
>  >  //create a page with a textview widget
>  >         protected virtual void onclicked (object sender, System.EventArgs 
> e)
>  >         {
>  >                 //i need a textview so i can show a hex file
>  >                 textview = new TextView();
>  >
>  >                  string label = "Hex output";
>  >
>  >                 notebook1.AppendPage (textview , new Label (label));
>  >
>  >                 notebook1.ShowAll();
>  >         }
>  >  i need to be able to close the page
>  >
>  >  thanks
>
>  Replace your AppendPage call with something like:
>
>  ------8<------
>  HBox hbox = new HBox();
>  hbox.PackStart(new Label(label));
>
>  Button close = new Button("X"); // Set this up with an image or whatever.
>  close.Relief = ReliefStyle.None;
>  close.FocusOnClick = false;
>  close.Clicked += delegate {
>     hbox.Destroy();
>     textview.Destroy();
>  };
>  hbox.PackStart(close);
>
>  hbox.ShowAll();
>
>  notebook1.AppendPage(textview, hbox);
>  ------8<------
>
>  --
>  Chris Howie
>  http://www.chrishowie.com
>  http://en.wikipedia.org/wiki/User:Crazycomputers
>
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to