A lightweight programming environment for desktop and mobile devices
delete_pane_button = function(x, y, r)
	return overflowable_button('delete', x, y, r,
		function()
			Show_menu = nil
			if Current_pane.example_name then
				Deleted_example_panes[Current_pane.example_name] = true
			end
			table.remove(Panes, Current_pane_index)
			if #Panes == 0 then
				table.insert(Panes, new_pane())
			end
			if Current_pane_index > #Panes then
				Current_pane_index = Current_pane_index-1
			end
			Current_pane = Panes[Current_pane_index]
			car = Current_pane.car or {}
			-- Don't load the deleted pane in future sessions.
			-- On mobile devices, we can't depend on on.save_settings() triggering on quit.
			love.filesystem.write('config', json.encode(settings()))
		end,
		--[[final button]] true)
end