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


Python TabWidgetChanged.subscribe方法代码示例

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


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

示例1: __init__

# 需要导入模块: from horizons.messaging import TabWidgetChanged [as 别名]
# 或者: from horizons.messaging.TabWidgetChanged import subscribe [as 别名]
	def __init__(self, session):
		from horizons.session import Session
		assert isinstance(session, Session)
		self.session = session

		# special slot because of special properties
		self.gold_gui = load_uh_widget(self.__class__.GOLD_ENTRY_GUI_FILE, style=self.__class__.STYLE)
		self.gold_gui.balance_visible = False
		self.gold_gui.child_finder = PychanChildFinder(self.gold_gui)
		gold_icon = self.gold_gui.child_finder("res_icon")
		gold_icon.image = get_res_icon_path(RES.GOLD)
		gold_icon.max_size = gold_icon.min_size = gold_icon.size = (32, 32)
		self.gold_gui.mapEvents({
		  "resbar_gold_container/mouseClicked/stats" : self._toggle_stats,
		  })
		self.gold_gui.helptext = _("Click to show statistics")
		self.stats_gui = None

		self.gui = [] # list of slots
		self.resource_configurations = weakref.WeakKeyDictionary()
		self.current_instance = weakref.ref(self) # can't weakref to None
		self.construction_mode = False
		self._last_build_costs = None
		self._do_show_dummy = False

		self._update_default_configuration()

		NewPlayerSettlementHovered.subscribe(self._on_different_settlement)
		TabWidgetChanged.subscribe(self._on_tab_widget_changed)

		# set now and then every few sec
		ExtScheduler().add_new_object(self._update_balance_display, self, run_in=0)
		ExtScheduler().add_new_object(self._update_balance_display, self, run_in=Player.STATS_UPDATE_INTERVAL, loops=-1)
开发者ID:Octavianuspg,项目名称:unknown-horizons,代码行数:35,代码来源:resourceoverviewbar.py

示例2: __init__

# 需要导入模块: from horizons.messaging import TabWidgetChanged [as 别名]
# 或者: from horizons.messaging.TabWidgetChanged import subscribe [as 别名]
	def __init__(self, session):
		from horizons.session import Session
		assert isinstance(session, Session)
		self.session = session

		# special slot because of special properties
		self.gold_gui = load_uh_widget(self.__class__.GOLD_ENTRY_GUI_FILE, style=self.__class__.STYLE)
		self.gold_gui.balance_visible = False
		self.gold_gui.child_finder = PychanChildFinder(self.gold_gui)
		self.gold_gui.child_finder("res_icon").image = get_res_icon_path(RES.GOLD, 32)

		self.gui = [] # list of slots
		self.resource_configurations = weakref.WeakKeyDictionary()
		self.current_instance = weakref.ref(self) # can't weakref to None
		self.construction_mode = False
		self._last_build_costs = None
		self._do_show_dummy = False

		self._update_default_configuration()

		NewPlayerSettlementHovered.subscribe(self._on_different_settlement)
		TabWidgetChanged.subscribe(self._on_tab_widget_changed)

		# set now and then every 2 sec
		ExtScheduler().add_new_object(self._update_balance_display, self, run_in=0)
		ExtScheduler().add_new_object(self._update_balance_display, self, run_in=2, loops=-1)
开发者ID:mage666,项目名称:unknown-horizons,代码行数:28,代码来源:resourceoverviewbar.py


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