On Monday, 5 August 2013, Manuel Quiñones wrote:
>
>
> In shell Activity.close(), to do the close directly if it is not a web
> activity.  If it is a web activity, emit the signal.  You said:
>
> > call get_window().close() only if the signal didn't return True
>
> but I would add: "or if it is not a web activity"
>

For non-web activities nothing will connect to the signal and no value will
be returned. I don't know very well how signal accumulators works in glib
but I suspect emit will just return None if no signal has been connected.
So emit would return True for web activities and None for gtk activities
and you would close the window only when None is returned. This pattern is
similar to delete_event in gtk, it gives a chance to some other code to
handle the event, and fallback to a default implementation if nothing does.


-- 
Daniel Narvaez
_______________________________________________
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to