1
2
3
4 import sys
5 if __name__ == '__main__':
6 import wx , os
7 import wx.lib.agw.persist as PM
8
9 class xf(wx.Frame):
10 def __init__(self, parent):
11 wx.Frame.__init__(self, parent, -1, " window maintains size and position after restart ")
12
13 self.Bind(wx.EVT_CLOSE, self.OnClose)
14
15 self._persistMgr = PM.PersistenceManager.Get()
16 _configFile = os.path.join(os.getcwd(), "persist-saved-cfg")
17 self._persistMgr.SetPersistenceFile(_configFile)
18 if not self._persistMgr.RegisterAndRestoreAll(self): print (" no workie ")
19
20 def OnClose(self, event):
21 self._persistMgr.SaveAndUnregister()
22 event.Skip()
23
24 a = wx.App()
25 f = xf(None)
26 selff =f
27 parenta=a
28
29 p=a.Traits.StandardPaths.Get()
30 print (str( wx.GetUserHome() ))
31 print (str( wx.StandardPaths.GetDataDir(p) ))
32 uh= wx.GetUserHome()
33 dd= wx.StandardPaths.GetDataDir(p)
34
35 f.Show ()
36 a.MainLoop()
CategoryHomepage
persist (last edited 2017-06-19 18:20:52 by ffx)