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


Python Gtk.StackSwitcher方法代码示例

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


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

示例1: build_widget

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import StackSwitcher [as 别名]
def build_widget(self):
        """
        Build the widget that contains the view, see
        :class:`~gui.views.pageview.PageView
        """
        container = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        container.set_border_width(12)

        self.header = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        self.header.show()

        self.stack = Gtk.Stack()
        ss = Gtk.StackSwitcher()
        ss.set_stack(self.stack)
        self.stack.show()
        ss.show()

        container.set_spacing(6)
        container.pack_start(self.header, False, False, 0)
        container.pack_start(Gtk.Separator(), False, False, 0)
        container.pack_start(ss, False, False, 0)
        container.pack_start(self.stack, True, True, 0)
        container.show_all()

        return container 
开发者ID:gramps-project,项目名称:addons-source,代码行数:27,代码来源:combinedview.py

示例2: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import StackSwitcher [as 别名]
def __init__(self):
        Gtk.Window.__init__(self)
        self.set_transient_for(Window.get_default())
        self.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
        self.set_size_request(600, 600)
        self.set_title(_("Settings"))
        self.resize(600, 600)

        self.stack_switcher = Gtk.StackSwitcher()
        self.stack = Gtk.Stack()

        self._build_widgets() 
开发者ID:bilelmoussaoui,项目名称:Authenticator,代码行数:14,代码来源:settings.py

示例3: on_screen_stack_children_changed

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import StackSwitcher [as 别名]
def on_screen_stack_children_changed(self, stack, child):
        if len(self.screen_stack.get_children()) > 1:
            # Display the StackSwitcher
            self.header_bar.set_custom_title(self.stack_switcher)
        else:
            # Display the Title / Subtitle
            self.header_bar.set_custom_title(None) 
开发者ID:KurtJacobson,项目名称:hazzy,代码行数:9,代码来源:main.py

示例4: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import StackSwitcher [as 别名]
def __init__(self, is_beta, wants_csd, **kwargs):
		super().__init__(**kwargs)
		if wants_csd:
			header_bar = Gtk.HeaderBar(visible=True, title=_("Preferences"), \
			                                             show_close_button=True)
			self.set_titlebar(header_bar)
			stack_switcher = Gtk.StackSwitcher(visible=True, stack=self.stack, \
			                                            halign=Gtk.Align.CENTER)
			header_bar.set_custom_title(stack_switcher)
			self.set_default_size(480, 500)
		else:
			stack_sidebar = Gtk.StackSidebar(visible=True, stack=self.stack)
			stack_sidebar.set_size_request(140, -1)
			self.content_area.pack_start(stack_sidebar, False, False, 0)
			self.set_default_size(600, 400) # Not high enough but the golden
			# ratio is more important than usability

		self.page_builder_images()
		self.page_builder_tools()
		self.page_builder_advanced(is_beta)

	# Each page_* attribute is a GtkGrid. The page_builder_* methods declare
	# their grid to be the currently filled one, and reset the counter.
	# Then, the page_builder_* methods will call the add_* methods, who will
	# build accurate widgets to be packed on the grid by the attach_* methods.

	############################################################################ 
开发者ID:maoschanz,项目名称:drawing,代码行数:29,代码来源:preferences.py


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