How to simulate window close button (what I'm really trying to do...)



OK, maybe I should tell people what I'm really trying to do - see my other post.

Actually, I've been sort of wondering about how one might simulate button clicks or manu selections or whatever, but what I was really looking for this time was to run the window close-button behaviour, and I thought I might try doing it by emitting a fake delete event signal. I'm not really sure this is a good idea, but at least it seemed cleaner that sending an actual event to myself...

In any case, I'm on to something that has sort of bugged me for years; in all my Gtk/Gtkmm window I generally have a button called "Close" or "Cancel", or a "Close" menu item, depending on the context, that is supposed to do *exactly* what a window manager close or "window delete" will do. It seems to me that this isn't exactly uncommon, so why is there no way of telling Gtk(mm) exactly what I want? I mean, why can't I just say, "please let this button do a window delete", and forget about the rest? Or can I do this?

I know I can just connect the hide() method to my button, but that's not really the same thing, as the WM "delete" actually leads to a chain of events that may or may not end in hide(). In the particular case I was looking at, the application will in fact stop handling the delete before it gets that far if certain conditions are met.

- Toralf



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]