本文整理汇总了Python中matplotlib.backends.backend_gtkagg.NavigationToolbar2GTKAgg.set_name方法的典型用法代码示例。如果您正苦于以下问题:Python NavigationToolbar2GTKAgg.set_name方法的具体用法?Python NavigationToolbar2GTKAgg.set_name怎么用?Python NavigationToolbar2GTKAgg.set_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_gtkagg.NavigationToolbar2GTKAgg
的用法示例。
在下文中一共展示了NavigationToolbar2GTKAgg.set_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AppView
# 需要导入模块: from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg [as 别名]
# 或者: from matplotlib.backends.backend_gtkagg.NavigationToolbar2GTKAgg import set_name [as 别名]
class AppView(BaseView, HasChildView, FormattedTitleView):
"""
The main application interface view.
Attributes:
project: the project view
specimen: the specimen view
markers: the markers view
phases: the phases view
atom_types: the atom_types view
statistics: the statistics view
mixtures: the mixtures view
"""
builder = resource_filename(__name__, "glade/application.glade")
top = "main_window"
title_format = "PyXRD - %s"
child_views = {
"project": ProjectView,
"specimen": SpecimenView,
"markers": EditMarkersView, # FIXME this should be part of the specimen view/controller code
"phases": ObjectListStoreView,
"atom_types": ObjectListStoreView,
# ("statistics": ???
"mixtures": ObjectListStoreView
}
widget_groups = {
'full_mode_only': [
"tbtn_edit_phases",
"tbtn_edit_atom_types",
"tbtn_edit_mixtures",
"tbtn_separator1",
"btn_sample",
"separator3",
"separator4",
"separator5",
"main_menu_item_edit_phases",
"main_menu_item_edit_atom_types",
"main_menu_item_edit_mixtures",
"navtoolbar"
]
}
# ------------------------------------------------------------
# Initialisation and other internals
# ------------------------------------------------------------
def __init__(self, *args, **kwargs):
super(AppView, self).__init__(*args, **kwargs)
# Setup about window:
def on_aboutbox_response(dialog, response, *args):
if response < 0:
dialog.hide()
dialog.emit_stop_by_name('response')
def on_aboutbox_close(widget, event=None):
self["about_window"].hide()
return gtk.TRUE
self["about_window"].set_version(settings.VERSION)
pixbuf = gtk.gdk.pixbuf_new_from_file(resource_filename(__name__, "icons/pyxrd.png")) # @UndefinedVariable
scaled_buf = pixbuf.scale_simple(212, 160, gtk.gdk.INTERP_BILINEAR) # @UndefinedVariable
self["about_window"].set_logo(scaled_buf)
self["about_window"].connect("response", on_aboutbox_response)
self["about_window"].connect("close", on_aboutbox_close)
self["about_window"].connect("delete_event", on_aboutbox_close)
self["main_window"].set_icon_list(*get_icon_list())
# self.set_layout_modes()
self.reset_all_views()
if not settings.DEBUG:
self.get_top_widget().maximize()
self.get_top_widget().show()
return
def setup_plot(self, plot_controller):
self.plot_controller = plot_controller
self["matplotlib_box"].add(self.plot_controller.canvas)
self["matplotlib_box"].show_all()
self.nav_toolbar = NavigationToolbar(self.plot_controller.canvas, self.get_top_widget())
self.nav_toolbar.set_name("navtoolbar")
self["navtoolbar"] = self.nav_toolbar
self["navtoolbar_box"].add(self.nav_toolbar)
def reset_child_view(self, view_name, class_type=None):
if getattr(self, view_name, None) is not None:
getattr(self, view_name).hide()
setattr(self, view_name, None)
if class_type == None:
class_type = self.child_views[view_name]
view = class_type(parent=self)
setattr(self, view_name, view)
view.set_layout_mode(self.current_layout_state)
#.........这里部分代码省略.........