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


Python ListView.change_page方法代码示例

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


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

示例1: change_page

# 需要导入模块: from gramps.gui.views.listview import ListView [as 别名]
# 或者: from gramps.gui.views.listview.ListView import change_page [as 别名]
    def change_page(self):
        """
        Called by viewmanager at end of realization when arriving on the page
        At this point the Toolbar is created. We need to:
          1. get the menutoolbutton
          2. add all possible map services in the drop down menu
          3. add the actions that correspond to clicking in this drop down menu
          4. set icon and label of the menutoolbutton now that it is realized
          5. store label so it can be changed when selection changes
        """
        ListView.change_page(self)
        #menutoolbutton has to be made and added in correct place on toolbar
        if not self.maptoolbtn:
            self.maptoolbtn = Gtk.MenuToolButton()
            self.maptoolbtn.set_icon_name('go-jump')
            self.maptoolbtn.connect('clicked', self.gotomap)
            self.mmenu = self.__create_maps_menu_actions()
            self.maptoolbtn.set_menu(self.mmenu)
            self.maptoolbtn.show()
        tb = self.uistate.viewmanager.uimanager.get_widget('/ToolBar')
        ind = tb.get_item_index(self.uistate.viewmanager.uimanager.get_widget(
                        '/ToolBar/CommonEdit/Merge'))
        tb.insert(self.maptoolbtn, ind+1)
        widget = self.maptoolbtn

        if not self.mapservicedata:
            return

        self.mapslistlabel = []
        if not self.mapservice in self.mapservicedata:
            #stored val no longer exists, use the first key instead
            self.set_mapservice(list(self.mapservicedata.keys())[0])

        #store all gtk labels to be able to update label on selection change_('Loading...'),
        widget.set_menu(self.mmenu)
        widget.set_arrow_tooltip_text(_('Select a Map Service'))
        widget.set_tooltip_text(
                          _("Attempt to see selected locations with a Map "
                            "Service (OpenstreetMap, Google Maps, ...)"))
        lbl = Gtk.Label(label=self.mapservice_label())
        lbl.show()
        self.mapslistlabel.append(lbl)
        widget.set_label_widget(self.mapslistlabel[-1])
        widget.set_icon_name('go-jump')
        if self.drag_info():
            self.list.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK,
              [],
              Gdk.DragAction.COPY)
            tglist = Gtk.TargetList.new([])
            tglist.add(self.drag_info().atom_drag_type,
                       self.drag_info().target_flags,
                       self.drag_info().app_id)
            tglist.add_text_targets (0)
            self.list.drag_source_set_target_list(tglist)
开发者ID:prculley,项目名称:gramps,代码行数:56,代码来源:libplaceview.py

示例2: change_page

# 需要导入模块: from gramps.gui.views.listview import ListView [as 别名]
# 或者: from gramps.gui.views.listview.ListView import change_page [as 别名]
 def change_page(self):
     """
     Called by viewmanager at end of realization when arriving on the page
     At this point the Toolbar is created. We need to:
       1. get the menutoolbutton
       2. add all possible map services in the drop down menu
       3. add the actions that correspond to clicking in this drop down menu
       4. set icon and label of the menutoolbutton now that it is realized
       5. store label so it can be changed when selection changes
     """
     ListView.change_page(self)
开发者ID:SNoiraud,项目名称:gramps,代码行数:13,代码来源:libplaceview.py


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