Re: [gedit-list] method called on gedit exit



On Mon, 2007-07-23 at 15:27 -0300, Lucas Stephanou wrote:
> 
> On 7/21/07, Paolo Maggi <paolo maggi gmail com> wrote:
>         Hi,
>         
>         > I need to emit a signal when gedit is to close.
>         
>         What do you mean with "gedit is to close"?
>         It is not easy to define such event.
>         You could probably define it as when the last window of a
>         running gedit 
>         instance receives a delete-event or a "quit" action.
> 
> Well, 
> Yes, It`s not easy to find right place to put this.

I'd just add a "EXITING" signal to GeditApp, which is fired when the
last window is closed. The code currently executed in that case would
naturally go into the signal default handler.

It could also be fired on app->exit, so in the default handler it could
just close all the windows.

It must just be consistent: it has to be fired everytime. You'll just
have pain to do it right when exiting by closing the last window.
(btw in that case, you can connect to the delete event of the windows,
and only react when the app's window list only contains one element)





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