当前位置: 首页>>代码示例>>Python>>正文


Python MainWindow.set_focus方法代码示例

本文整理汇总了Python中MainWindow.MainWindow.set_focus方法的典型用法代码示例。如果您正苦于以下问题:Python MainWindow.set_focus方法的具体用法?Python MainWindow.set_focus怎么用?Python MainWindow.set_focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MainWindow.MainWindow的用法示例。


在下文中一共展示了MainWindow.set_focus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from MainWindow import MainWindow [as 别名]
# 或者: from MainWindow.MainWindow import set_focus [as 别名]

#.........这里部分代码省略.........
        # Gen/Exec/Stop
        ##################################################
        elif action == Actions.FLOW_GRAPH_GEN:
            if not self.get_page().get_proc():
                if not self.get_page().get_saved() or not self.get_page().get_file_path():
                    Actions.FLOW_GRAPH_SAVE() #only save if file path missing or not saved
                if self.get_page().get_saved() and self.get_page().get_file_path():
                    generator = self.get_page().get_generator()
                    try:
                        Messages.send_start_gen(generator.get_file_path())
                        generator.write()
                    except Exception,e: Messages.send_fail_gen(e)
                else: self.generator = None
        elif action == Actions.FLOW_GRAPH_EXEC:
            if not self.get_page().get_proc():
                Actions.FLOW_GRAPH_GEN()
                if self.get_page().get_saved() and self.get_page().get_file_path():
                    ExecFlowGraphThread(self)
        elif action == Actions.FLOW_GRAPH_KILL:
            if self.get_page().get_proc():
                try: self.get_page().get_proc().kill()
                except: print "could not kill process: %d"%self.get_page().get_proc().pid
        elif action == Actions.PAGE_CHANGE: #pass and run the global actions
            pass
        elif action == Actions.RELOAD_BLOCKS:
            self.platform.load_blocks()
            self.main_window.btwin.clear()
            self.platform.load_block_tree(self.main_window.btwin)
            Actions.XML_PARSER_ERRORS_DISPLAY.set_sensitive(bool(ParseXML.xml_failures))
            Messages.send_xml_errors_if_any(ParseXML.xml_failures)
        elif action == Actions.FIND_BLOCKS:
            self.main_window.btwin.show()
            self.main_window.btwin.search_entry.show()
            self.main_window.set_focus(self.main_window.btwin.search_entry)
        elif action == Actions.OPEN_HIER:
            bn = [];
            for b in self.get_flow_graph().get_selected_blocks():
                if b._grc_source:
                    self.main_window.new_page(b._grc_source, show=True);
        elif action == Actions.BUSSIFY_SOURCES:
            n = {'name':'bus', 'type':'bus'}
            for b in self.get_flow_graph().get_selected_blocks():
                b.bussify(n, 'source');
            self.get_flow_graph()._old_selected_port = None;
            self.get_flow_graph()._new_selected_port = None;
            Actions.ELEMENT_CREATE();
            
        elif action == Actions.BUSSIFY_SINKS:
            n = {'name':'bus', 'type':'bus'}
            for b in self.get_flow_graph().get_selected_blocks():
                b.bussify(n, 'sink')
            self.get_flow_graph()._old_selected_port = None;
            self.get_flow_graph()._new_selected_port = None;
            Actions.ELEMENT_CREATE();
        else: print '!!! Action "%s" not handled !!!'%action
        ##################################################
        # Global Actions for all States
        ##################################################
        #update general buttons
        Actions.ERRORS_WINDOW_DISPLAY.set_sensitive(not self.get_flow_graph().is_valid())
        Actions.ELEMENT_DELETE.set_sensitive(bool(self.get_flow_graph().get_selected_elements()))
        Actions.BLOCK_PARAM_MODIFY.set_sensitive(bool(self.get_flow_graph().get_selected_block()))
        Actions.BLOCK_ROTATE_CCW.set_sensitive(bool(self.get_flow_graph().get_selected_blocks()))
        Actions.BLOCK_ROTATE_CW.set_sensitive(bool(self.get_flow_graph().get_selected_blocks()))
        #update cut/copy/paste
        Actions.BLOCK_CUT.set_sensitive(bool(self.get_flow_graph().get_selected_blocks()))
开发者ID:36V3mA21Hz,项目名称:gnuradio,代码行数:70,代码来源:ActionHandler.py


注:本文中的MainWindow.MainWindow.set_focus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。