示例#1
0
def do_close(win):
    if win.busy:
        stdwin.message('Can\'t close busy window')
        return  # need to fail if quitting??
    win.editor = None  # Break circular reference
    #del win.editmenu	# What about the filemenu??
    mainloop.unregister(win)
    win.close()
示例#2
0
def do_close(win):
	if win.busy:
		stdwin.message('Can\'t close busy window')
		return		# need to fail if quitting??
	win.editor = None # Break circular reference
	#del win.editmenu	# What about the filemenu??
	mainloop.unregister(win)
	win.close()
示例#3
0
	def close(self):
		if self in allwindows:
			allwindows.remove(self)
		mainloop.unregister(self.window)
		self.window.dispatch = None
		self.window.close()
		if self.history:
			wwwutil.save_file(self.history + [self.cur_addr], \
					  history_file, HISTORY)
		wwwutil.save_file(bookmarks, bookmarks_file, BOOKMARKS)
		wwwutil.save_file(places, places_file, PLACES)
示例#4
0
def lpdispatch(event):
	type, win, detail = event
	if type == WE_CLOSE or type == WE_CHAR and detail in ('q', 'Q'):
		mainloop.unregister(win)
	elif type == WE_DRAW:
		drawproc(win)
	elif type == WE_TIMER:
		update(win)
		win.change((0,0), (10000, 10000))
	elif type == WE_MOUSE_UP:
		win.settimer(1)
示例#5
0
 def close(self):
     if self in allwindows:
         allwindows.remove(self)
     mainloop.unregister(self.window)
     self.window.dispatch = None
     self.window.close()
     if self.history:
         wwwutil.save_file(self.history + [self.cur_addr], \
             history_file, HISTORY)
     wwwutil.save_file(bookmarks, bookmarks_file, BOOKMARKS)
     wwwutil.save_file(places, places_file, PLACES)
示例#6
0
def cdispatch(event):
	type, win, detail = event
	if type == WE_DRAW:
		drawproc(win, detail)
	elif type == WE_TIMER:
		settimer(win)
		drawproc(win, EVERYWHERE)
	elif type in MOUSE_EVENTS:
		mouseclick(win, type, detail)
	elif type == WE_ACTIVATE:
		if win.ring:
			# Turn the ringing off
			win.ring = 0
			win.begindrawing().invert(win.mainarea)
	elif type == WE_SIZE:
		win.change(EVERYWHERE)
		setdimensions(win)
	elif type == WE_CLOSE:
		mainloop.unregister(win)
		win.close()
示例#7
0
def cdispatch(event):
    type, win, detail = event
    if type == WE_DRAW:
        drawproc(win, detail)
    elif type == WE_TIMER:
        settimer(win)
        drawproc(win, EVERYWHERE)
    elif type in MOUSE_EVENTS:
        mouseclick(win, type, detail)
    elif type == WE_ACTIVATE:
        if win.ring:
            # Turn the ringing off
            win.ring = 0
            win.begindrawing().invert(win.mainarea)
    elif type == WE_SIZE:
        win.change(EVERYWHERE)
        setdimensions(win)
    elif type == WE_CLOSE:
        mainloop.unregister(win)
        win.close()
示例#8
0
def cddispatch(type, win, detail):
	if type == WE_NULL:
		pass
	elif type == WE_CLOSE:
		mainloop.unregister(win)
		win.close()
	elif type == WE_DRAW:
		draw(win)
	elif type == WE_TIMER:
		update(win)
	elif type == WE_MOUSE_UP:
		left, top, right, bottom, v1, v2 = getgeo(win)
		h, v = detail[0]
		if left < h < right:
			if top < v < v1:
				but1(win)
			elif v1 < v < v2:
				but2(win)
			elif v2 < v < bottom:
				but3(win)
			else:
				stdwin.fleep()
示例#9
0
文件: cdwin.py 项目: 8Banana/py1.0
def cddispatch(type, win, detail):
    if type == WE_NULL:
        pass
    elif type == WE_CLOSE:
        mainloop.unregister(win)
        win.close()
    elif type == WE_DRAW:
        draw(win)
    elif type == WE_TIMER:
        update(win)
    elif type == WE_MOUSE_UP:
        left, top, right, bottom, v1, v2 = getgeo(win)
        h, v = detail[0]
        if left < h < right:
            if top < v < v1:
                but1(win)
            elif v1 < v < v2:
                but2(win)
            elif v2 < v < bottom:
                but3(win)
            else:
                stdwin.fleep()
示例#10
0
def close(w):				# Close method
	unregister(w)
	del w.close	# Delete our close function
	w.close()	# Call the close method
示例#11
0
	def destroy(self):
		mainloop.unregister(self.win)
		if self.child: self.child.destroy()
		self._reset()
示例#12
0
def close(w):  # Close method
    unregister(w)
    del w.close  # Delete our close function
    w.close()  # Call the close method
示例#13
0
	def close(self):
		mainloop.unregister(self.win)
		del self.win.dispatch
		self.win.close()