Changeset 182:dd806c3cc18d for src/mlx
- Timestamp:
- 05/15/12 15:01:07 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/gui.py
r178 r182 19 19 import mlx.acft as acft 20 20 import mlx.web as web 21 import mlx.singleton as singleton 21 22 from mlx.i18n import xstr 22 23 from mlx.pirep import PIREP … … 306 307 self._mainWindow) 307 308 self._updater.start() 308 309 310 singleton.raiseCallback = self.raiseCallback 309 311 gtk.main() 312 singleton.raiseCallback = None 310 313 311 314 self._disconnect() … … 499 502 (event.new_window_state&iconified)!=0: 500 503 self.hideMainWindow(savePosition = False) 504 505 def raiseCallback(self): 506 """Callback for the singleton handling code.""" 507 gobject.idle_add(self.raiseMainWindow) 508 509 def raiseMainWindow(self): 510 """SHow the main window if invisible, and raise it.""" 511 if not self._mainWindow.get_visible(): 512 self.showMainWindow() 513 self._mainWindow.present() 501 514 502 515 def hideMainWindow(self, savePosition = True): -
src/mlx/mlx.py
r160 r182 44 44 def main(): 45 45 """The main operation of the program.""" 46 from singleton import SingleInstance, raiseCallbackWrapper 47 48 instance = SingleInstance("mlx", raiseCallbackWrapper) 49 if not instance: return 50 46 51 programDirectory = os.path.dirname(sys.argv[0]) 47 52 … … 79 84 80 85 if __name__ == "__main__": 81 main() 86 if instance: 87 main()
Note:
See TracChangeset
for help on using the changeset viewer.