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


Python Actions.get_accel_group方法代码示例

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


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

示例1: __init__

# 需要导入模块: import Actions [as 别名]
# 或者: from Actions import get_accel_group [as 别名]
 def __init__(self, platform, action_handler_callback):
     """
     MainWindow contructor
     Setup the menu, toolbar, flowgraph editor notebook, block selection window...
     """
     self._platform = platform
     gen_opts = platform.get_block('options').get_param('generate_options')
     generate_mode_default = gen_opts.get_value()
     generate_modes = [
         (o.get_key(), o.get_name(), o.get_key() == generate_mode_default)
         for o in gen_opts.get_options()]
     # load preferences
     Preferences.load(platform)
     #setup window
     gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
     vbox = gtk.VBox()
     self.hpaned = gtk.HPaned()
     self.add(vbox)
     #create the menu bar and toolbar
     self.add_accel_group(Actions.get_accel_group())
     self.menu_bar = Bars.MenuBar(generate_modes, action_handler_callback)
     vbox.pack_start(self.menu_bar, False)
     self.tool_bar = Bars.Toolbar(generate_modes, action_handler_callback )
     vbox.pack_start(self.tool_bar, False)
     vbox.pack_start(self.hpaned)
     #create the notebook
     self.notebook = gtk.Notebook()
     self.page_to_be_closed = None
     self.current_page = None
     self.notebook.set_show_border(False)
     self.notebook.set_scrollable(True) #scroll arrows for page tabs
     self.notebook.connect('switch-page', self._handle_page_change)
     #setup containers
     self.flow_graph_vpaned = gtk.VPaned()
     #flow_graph_box.pack_start(self.scrolled_window)
     self.flow_graph_vpaned.pack1(self.notebook)
     self.hpaned.pack1(self.flow_graph_vpaned)
     self.btwin = BlockTreeWindow(platform, self.get_flow_graph);
     self.hpaned.pack2(self.btwin, False) #dont allow resize
     #create the reports window
     self.text_display = TextDisplay()
     #house the reports in a scrolled window
     self.reports_scrolled_window = gtk.ScrolledWindow()
     self.reports_scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
     self.reports_scrolled_window.add(self.text_display)
     self.reports_scrolled_window.set_size_request(-1, DEFAULT_REPORTS_WINDOW_WIDTH)
     self.flow_graph_vpaned.pack2(self.reports_scrolled_window, False) #dont allow resize
     #load preferences and show the main window
     self.resize(*Preferences.main_window_size())
     self.flow_graph_vpaned.set_position(Preferences.reports_window_position())
     self.hpaned.set_position(Preferences.blocks_window_position())
     self.show_all()
     self.reports_scrolled_window.hide()
     self.btwin.hide()
开发者ID:Sophrinix,项目名称:gnuradio,代码行数:56,代码来源:MainWindow.py

示例2: __init__

# 需要导入模块: import Actions [as 别名]
# 或者: from Actions import get_accel_group [as 别名]
    def __init__(self, platform):
        """
		MainWindow contructor
		Setup the menu, toolbar, flowgraph editor notebook, block selection window...
		"""
        self._platform = platform
        # setup window
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
        vbox = gtk.VBox()
        self.hpaned = gtk.HPaned()
        self.add(vbox)
        # create the menu bar and toolbar
        self.add_accel_group(Actions.get_accel_group())
        vbox.pack_start(Bars.MenuBar(), False)
        vbox.pack_start(Bars.Toolbar(), False)
        vbox.pack_start(self.hpaned)
        # create the notebook
        self.notebook = gtk.Notebook()
        self.page_to_be_closed = None
        self.current_page = None
        self.notebook.set_show_border(False)
        self.notebook.set_scrollable(True)  # scroll arrows for page tabs
        self.notebook.connect("switch-page", self._handle_page_change)
        # setup containers
        self.flow_graph_vpaned = gtk.VPaned()
        # flow_graph_box.pack_start(self.scrolled_window)
        self.flow_graph_vpaned.pack1(self.notebook)
        self.hpaned.pack1(self.flow_graph_vpaned)
        self.btwin = BlockTreeWindow(platform, self.get_flow_graph)
        self.hpaned.pack2(self.btwin, False)  # dont allow resize
        # create the reports window
        self.text_display = TextDisplay()
        # house the reports in a scrolled window
        self.reports_scrolled_window = gtk.ScrolledWindow()
        self.reports_scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.reports_scrolled_window.add_with_viewport(self.text_display)
        self.reports_scrolled_window.set_size_request(-1, DEFAULT_REPORTS_WINDOW_WIDTH)
        self.flow_graph_vpaned.pack2(self.reports_scrolled_window, False)  # dont allow resize
        # load preferences and show the main window
        Preferences.load(platform)
        self.resize(*Preferences.main_window_size())
        self.flow_graph_vpaned.set_position(Preferences.reports_window_position())
        self.hpaned.set_position(Preferences.blocks_window_position())
        self.show_all()
开发者ID:,项目名称:,代码行数:46,代码来源:


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