Created
June 30, 2017 14:05
-
-
Save arteymix/28252bcc99fe7fdafaa4b254cecc8e11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ErrorHandler { | |
public signal void publish (Error err); | |
private static ErrorHandler _default; | |
public static ErrorHandler get_default () { | |
if (_default == null) { | |
_default = new ErrorHandler (); | |
} | |
return _default; | |
} | |
} | |
// from the main window | |
ErrorHandler.get_default ().publish.connect ((err) => { | |
// handle error | |
}); | |
// from the GtkBox | |
ErrorHandler.get_default ().publish (new IOError.FAILED ("")); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment