CloseButton in a Window

View: New views
3 Messages — Rating Filter:   Alert me  

CloseButton in a Window

by Wolfgang Mauer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
is it possible to put a button inside a windows that will do the same action as the "X" on a decorated Windowframe?

Thanks for help
Wolfgang
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Parent Message unknown Re: CloseButton in a Window

by Wolfgang Mauer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks,
but sorry thats not what i am looking for.
I down want to quit the application, just want to close one single TopLevel window.
On the "X" i get a DeleteEvent, but normaly on a button, how i know, i must call Destroy() ?!
So i'm looking for a easy way to have just one event/method.

/
Wolfgang

> Yes any button can be a close button. Are you looking for a simple close
> or a close with some checks (like "Save before close?") in place?
>
> Also is this closing a dialog or an application as a whole? For
> Exit/Quit an application you simply put the following as it's event
>
>         protected virtual void MyButton_Clicked (object sender,
> System.EventArgs e)
>         {
>              // put any checks that you need here
>             Gtk.Application.Quit();
>         }
>
> Does that help?
>
> Spoody Goon
>
>
> Wolfgang Mauer wrote:
> > Hi all,
> > is it possible to put a button inside a windows that will do the same action as the "X" on a decorated Windowframe?
> >
> > Thanks for help
> > Wolfgang
> > _______________________________________________
> > Gtk-sharp-list maillist  -  Gtk-sharp-list@...
> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> > ------------------------------------------------------------------------
> >
> >
> > No virus found in this incoming message.
> > Checked by AVG - www.avg.com
> > Version: 8.5.392 / Virus Database: 270.13.41/2277 - Release Date: 08/02/09 05:56:00
> >
> >  
>
>



--
Top-Soft
Softwareentwicklung
Inhaber: Wolfgang Mauer
Reitersweg 9, 96103 Hallstadt
Tel.: +49 (0)951 / 2221520
Fax: +49 (0)951 / 2221521
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Re: CloseButton in a Window

by Chris Howie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Aug 2, 2009 at 9:13 AM, Wolfgang Mauer<W.Mauer@...> wrote:
> Thanks,
> but sorry thats not what i am looking for.
> I down want to quit the application, just want to close one single TopLevel window.
> On the "X" i get a DeleteEvent, but normaly on a button, how i know, i must call Destroy() ?!
> So i'm looking for a easy way to have just one event/method.

Calling yourWindow.Destroy() should do what you want.  All of the
widgets contained in the window will also be destroyed and their
memory freed.

--
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list