pygobject/XApp.py: simplify and add an explanation as to why this
file is here (to remind me in a year.)
Michael Webster
6 years ago
0 | 0 | from gi.overrides import override |
1 | 1 | from gi.importer import modules |
2 | ||
3 | """ | |
4 | The only purpose of this file is to ensure the XApp widget GType is registered | |
5 | at the time of import. Otherwise any user of XApp.GtkWindow would have to create | |
6 | a dummy widget prior to using a GtkBuilder to parse a ui file containing an | |
7 | XAppGtkWindow. | |
8 | ||
9 | The gi import machinery sweeps usr/lib/python*/dist-packages/gi/overrides for file | |
10 | matching the module name at the time of execution. | |
11 | ||
12 | This file needs to be in both python2 and python3 overrides locations. | |
13 | ||
14 | """ | |
2 | 15 | |
3 | 16 | XApp = modules['XApp']._introspection_module |
4 | 17 | |
5 | 18 | __all__ = [] |
6 | 19 | |
7 | 20 | class GtkWindow(XApp.GtkWindow): |
8 | ||
9 | def __init__(self, *args, **kwargs): | |
10 | XApp.GtkWindow.__init__(self, *args, **kwargs) | |
21 | pass | |
11 | 22 | |
12 | 23 | GtkWindow = override(GtkWindow) |
13 | 24 | __all__.append('GtkWindow') |