151 self._should_write() |
151 self._should_write() |
152 with self.TimerAccessLock: |
152 with self.TimerAccessLock: |
153 self.LastRefreshTimer = None |
153 self.LastRefreshTimer = None |
154 |
154 |
155 def _should_write(self): |
155 def _should_write(self): |
156 if MainThread == currentThread().ident: |
156 if MainThread == current_thread().ident: |
157 app = wx.GetApp() |
157 app = wx.GetApp() |
158 if app is not None: |
158 if app is not None: |
159 self._write() |
159 self._write() |
160 if self.YieldLock.acquire(0): |
160 if self.YieldLock.acquire(0): |
161 app.Yield() |
161 app.Yield() |
245 def _init_coll_FileMenu_Items(self, parent): |
245 def _init_coll_FileMenu_Items(self, parent): |
246 AppendMenu(parent, help='', id=wx.ID_NEW, |
246 AppendMenu(parent, help='', id=wx.ID_NEW, |
247 kind=wx.ITEM_NORMAL, text=_('New') + '\tCTRL+N') |
247 kind=wx.ITEM_NORMAL, text=_('New') + '\tCTRL+N') |
248 AppendMenu(parent, help='', id=wx.ID_OPEN, |
248 AppendMenu(parent, help='', id=wx.ID_OPEN, |
249 kind=wx.ITEM_NORMAL, text=_('Open') + '\tCTRL+O') |
249 kind=wx.ITEM_NORMAL, text=_('Open') + '\tCTRL+O') |
250 parent.Append(ID_FILEMENURECENTPROJECTS, _("&Recent Projects"), self.RecentProjectsMenu) |
250 self.RecentProjectsMenuItem = parent.AppendSubMenu(self.RecentProjectsMenu, _("&Recent Projects")) |
251 parent.AppendSeparator() |
251 parent.AppendSeparator() |
252 parent.Append(wx.ID_ANY, _("&Tutorials and Examples"), self.TutorialsProjectsMenu) |
252 parent.AppendSubMenu(self.TutorialsProjectsMenu, _("&Tutorials and Examples")) |
253 |
253 |
254 exemples_dir = Bpath("exemples") |
254 exemples_dir = Bpath("exemples") |
255 project_list = sorted(os.listdir(exemples_dir)) |
255 project_list = sorted(os.listdir(exemples_dir)) |
256 |
256 |
257 for idx, dirname in enumerate(project_list): |
257 for idx, dirname in enumerate(project_list): |
705 |
705 |
706 while self.RecentProjectsMenu.GetMenuItemCount() > 0: |
706 while self.RecentProjectsMenu.GetMenuItemCount() > 0: |
707 item = self.RecentProjectsMenu.FindItemByPosition(0) |
707 item = self.RecentProjectsMenu.FindItemByPosition(0) |
708 self.RecentProjectsMenu.Remove(item) |
708 self.RecentProjectsMenu.Remove(item) |
709 |
709 |
710 self.FileMenu.Enable(ID_FILEMENURECENTPROJECTS, len(recent_projects) > 0) |
710 self.RecentProjectsMenuItem.Enable(len(recent_projects) > 0) |
711 for idx, projectpath in enumerate(recent_projects): |
711 for idx, projectpath in enumerate(recent_projects): |
712 text = '&%d: %s' % (idx + 1, projectpath) |
712 text = '&%d: %s' % (idx + 1, projectpath) |
713 |
713 |
714 item = self.RecentProjectsMenu.Append(wx.ID_ANY, text, '') |
714 item = self.RecentProjectsMenu.Append(wx.ID_ANY, text, '') |
715 self.Bind(wx.EVT_MENU, self.GenerateOpenRecentProjectFunction(projectpath), item) |
715 self.Bind(wx.EVT_MENU, self.GenerateOpenRecentProjectFunction(projectpath), item) |