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


Python MapList.delete方法代码示例

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


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

示例1: delete_clicked

# 需要导入模块: from MapList import MapList [as 别名]
# 或者: from MapList.MapList import delete [as 别名]
	def delete_clicked (self, button):
		map = self.get_selected_map ()
		if not map:
			raise "You clicked on delete but had no map selected"
		error_message = ""
		if map.window:
			error_message =  _("The map cannot be deleted right now. Is it open?")
		elif not map.filename:
			error_message = _("The map has no associated filename.")
		if error_message:
			dialog = Gtk.MessageDialog (self, Gtk.DialogFlags.MODAL, Gtk.MessageType.WARNING, Gtk.ButtonsType.OK,
 									_("Cannot delete this map"))
			dialog.format_secondary_text (error_message)
			dialog.run ()
			dialog.hide ()
			del (dialog)
			return
		dialog = Gtk.MessageDialog (self, Gtk.DialogFlags.MODAL, Gtk.MessageType.WARNING, Gtk.ButtonsType.YES_NO,
									_("Do you really want to delete this Map?"))
		resp = dialog.run ()
		dialog.hide ()
		del (dialog)
		if resp != Gtk.ResponseType.YES:
			return
		MapList.delete (map)
		self.view.emit ('cursor-changed')
开发者ID:Boquete,项目名称:activity-labyrinth,代码行数:28,代码来源:Browser.py

示例2: remove_map_cb

# 需要导入模块: from MapList import MapList [as 别名]
# 或者: from MapList.MapList import delete [as 别名]
	def remove_map_cb (self, mobj, a):
		map = MapList.get_by_window(mobj)
		if map:
		    MapList.delete(map)
		    self.view.emit ('cursor-changed')
		    return
		raise "Cant remove map of window %s" % mobj
开发者ID:Boquete,项目名称:activity-labyrinth,代码行数:9,代码来源:Browser.py

示例3: delete_clicked

# 需要导入模块: from MapList import MapList [as 别名]
# 或者: from MapList.MapList import delete [as 别名]
 def delete_clicked (self, button):
     map = self.get_selected_map ()
     if not map:
         raise ValueError("You clicked on delete but had no map selected")
     error_message = ""
     if map.window:
         error_message =  _("The map cannot be deleted right now. Is it open?")
     elif not map.filename:
         error_message = _("The map has no associated filename.")
     if error_message:
         dialog = gtk.MessageDialog (self, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK,
                                                         _("Cannot delete this map"))
         dialog.format_secondary_text (error_message)
         dialog.run ()
         dialog.hide ()
         del (dialog)
         return
     dialog = gtk.MessageDialog (self, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_YES_NO,
                                                             _("Do you really want to delete this Map?"))
     resp = dialog.run ()
     dialog.hide ()
     del (dialog)
     if resp != gtk.RESPONSE_YES:
         return
     MapList.delete (map)
     self.view.emit ('cursor-changed')
开发者ID:amilapsn,项目名称:labyrinth,代码行数:28,代码来源:Browser.py


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