def OnInitDialog(self): win32ui.SetProfileFileName('pytimer.ini') self.title = win32ui.GetProfileVal(self.timerAppName, "Title", "Remote System Timer") self.buildTimer = win32ui.GetProfileVal(self.timerAppName, "Timer", "EachMinuteIntervaler()") self.doWork = win32ui.GetProfileVal(self.timerAppName, "Work", "DoDemoWork()") # replace "\n" with real \n. self.doWork = self.doWork.replace('\\n', '\n') dlgappcore.AppDialog.OnInitDialog(self) self.SetWindowText(self.title) self.prompt1 = self.GetDlgItem(win32ui.IDC_PROMPT1) self.prompt2 = self.GetDlgItem(win32ui.IDC_PROMPT2) self.prompt3 = self.GetDlgItem(win32ui.IDC_PROMPT3) self.butOK = self.GetDlgItem(win32con.IDOK) self.butCancel = self.GetDlgItem(win32con.IDCANCEL) self.prompt1.SetWindowText("Python Timer App") self.prompt2.SetWindowText("") self.prompt3.SetWindowText("") self.butOK.SetWindowText("Do it now") self.butCancel.SetWindowText("Close") self.timerManager = TimerManager(self) self.ProcessArgs(sys.argv[self.argOff:]) self.timerManager.go() return 1
def InitInstance(self): win32ui.SetProfileFileName('dlgapp.ini') win32ui.LoadStdProfileSettings() win32ui.EnableControlContainer() win32ui.Enable3dControls() self.dlg = self.frame = self.CreateDialog() if self.frame is None: raise error, "No dialog was created by CreateDialog()" return self._obj_.InitDlgInstance(self.dlg) self.PreDoModal() self.dlg.DoModal() self.PostDoModal()