當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。