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


Python Gtk.Viewport方法代码示例

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


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

示例1: test_image_thumbnail

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Viewport [as 别名]
def test_image_thumbnail(self):
        """Switch between image and thumbnail mode."""
        self.assertTrue(self.vimiv["main_window"].is_focus())
        self.assertTrue(self.vimiv["main_window"].is_visible())
        self.assertEqual(type(self.vimiv["main_window"].get_child()),
                         Gtk.Viewport)  # We do not know the exact viewport

        self.vimiv["thumbnail"].toggle()
        self.assertTrue(self.vimiv["thumbnail"].is_focus())
        self.assertEqual(self.vimiv["main_window"].get_child(),
                         self.vimiv["thumbnail"])
        self.assertEqual(self.vimiv["thumbnail"].last_focused, "im")
        # Quick insert of thumbnail <-> manipulate as it would be to expensive
        # to write an extra thumbnail class for this
        self.vimiv["manipulate"].toggle()
        self.assertTrue(self.vimiv["thumbnail"].is_focus())
        self.assertFalse(self.vimiv["manipulate"].is_visible())
        self.check_statusbar(
            "WARNING: Manipulate not supported in thumbnail mode")

        self.vimiv["thumbnail"].toggle()
        self.assertTrue(self.vimiv["main_window"].is_focus())
        self.assertEqual(type(self.vimiv["main_window"].get_child()),
                         Gtk.Viewport) 
开发者ID:karlch,项目名称:vimiv,代码行数:26,代码来源:modeswitch_test.py

示例2: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Viewport [as 别名]
def __init__(self, service, database, view_out_scope=True):
		""" servicesview workspace tab """
		builder	 = Gtk.Builder() # glade
		builder.add_from_file(os.path.dirname(os.path.abspath(__file__)) + "/../assets/ui/servicesview.glade")	

		self.database = database
		self.service  = service

		self.notebook = builder.get_object("notebook1")
		self.portlistframe = builder.get_object("portlistframe")

		# creating the treeview, making it use the filter as a model, and adding the columns
		self.treeview = ServicesTree(self.database, self.service)

		scrolled = Gtk.ScrolledWindow()
		viewport = Gtk.Viewport()

		scrolled.add(viewport)
		viewport.add(self.treeview)
		scrolled.show_all()

		self.portlistframe.add(scrolled)

		self.refresh(self.database, view_out_scope=view_out_scope) 
开发者ID:r3vn,项目名称:badKarma,代码行数:26,代码来源:workspace.py

示例3: set_scroll_position

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Viewport [as 别名]
def set_scroll_position(widget, value, direction='vertical', window=None):
  viewport = widget.get_ancestor(Gtk.Viewport)

  if direction == 'vertical':
    viewport.get_vadjustment().set_value(value)

  if direction == 'horizontal':
    viewport.get_hadjustment().set_value(value)

  if window is not None:
    window.queue_resize_no_redraw() 
开发者ID:jonian,项目名称:kickoff-player,代码行数:13,代码来源:gtk.py

示例4: load

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Viewport [as 别名]
def load(self, gmwidg):
        self.boardview = gmwidg.board.view
        self.plot = ScorePlot(self.boardview)
        self.sw = __widget__ = Gtk.ScrolledWindow()
        __widget__.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
        port = Gtk.Viewport()
        port.add(self.plot)
        port.set_shadow_type(Gtk.ShadowType.NONE)
        __widget__.add(port)
        __widget__.show_all()

        self.plot_cid = self.plot.connect("selected", self.plot_selected)
        self.cid = self.boardview.connect('shownChanged', self.shownChanged)
        self.model_cids = [
            self.boardview.model.connect_after("game_changed", self.game_changed),
            self.boardview.model.connect_after("moves_undone", self.moves_undone),
            self.boardview.model.connect_after("analysis_changed", self.analysis_changed),
            self.boardview.model.connect_after("game_started", self.game_started),
            self.boardview.model.connect_after("game_terminated", self.on_game_terminated),
        ]

        def cb_config_changed(none):
            self.fetch_chess_conf()
            self.plot.redraw()
        self.cids_conf = [
            conf.notify_add("scoreLinearScale", cb_config_changed)
        ]
        self.fetch_chess_conf()

        uistuff.keepDown(__widget__)

        return __widget__ 
开发者ID:pychess,项目名称:pychess,代码行数:34,代码来源:scorePanel.py

示例5: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Viewport [as 别名]
def __init__(self, database, host, *args, **kwargs):
		super(host_informations, self).__init__(*args, **kwargs)
		""" single host information widget """

		builder	 = Gtk.Builder() # glade
		builder.add_from_file(os.path.dirname(os.path.abspath(__file__)) + "/../assets/ui/widgets.glade")

		self.info_viewport  = builder.get_object("host-info-viewport")
		self.info_mac		= builder.get_object("info-mac")
		self.info_os		= builder.get_object("info-os")
		self.info_vendor    = builder.get_object("info-vendor")

		self.info_status	= builder.get_object("info-status")
		self.info_address   = builder.get_object("info-address")
		self.info_hostnames = builder.get_object("info-hostnames")
		self.info_distance  = builder.get_object("info-distance")
		self.info_tcpseq	= builder.get_object("info-tcpseq")
		self.info_uptime	= builder.get_object("info-uptime")
		
		self.info_latitude  = builder.get_object("info-latitude")
		self.info_longitude = builder.get_object("info-longitude")

		self.info_isp          = builder.get_object("info-isp")
		self.info_country_code = builder.get_object("info-country_code")
		self.info_country_name = builder.get_object("info-country_name")
		self.info_organization = builder.get_object("info-organization")

		viewport = Gtk.Viewport()
		viewport.add(self.info_viewport)
		viewport.set_vexpand(True)
		viewport.set_hexpand(True)

		self.add(viewport)
		self.set_property("height-request", 400)
		self.show_all()

		self.database = database
		self.host     = host

		self.refresh(self.database, self.host) 
开发者ID:r3vn,项目名称:badKarma,代码行数:42,代码来源:widgets.py


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