Beispiel #1
0
		def options_update():
			g.timeout_remove(self.update_timeout)
			self.update_display(battery)
			# print str(int(self.ticks_till_update.int_value) * 100)
			print self.text_font			
			self.set_size_request(self.applet_width.int_value, -1)
			self.update_timeout = g.timeout_add(int(self.ticks_till_update.int_value) * 100, self.update_display, battery)
Beispiel #2
0
	def pan(self):
		def scale(x):
			val = (float(abs(x)) ** 1.4)
			if x < 0:
				return -val
			else:
				return val
		def chop(x):
			if x > 10: return x - 10
			if x < -10: return x + 10
			return 0
		x, y, mask = self.surface.window.get_pointer()
		sx, sy = self.pan_start
		dx, dy = scale(chop(x - sx)) / 20, scale(chop(y - sy))
		dx = max(dx, 10 - self.h_limits[1])
		dx = min(dx, self.last_alloc[0] - 10 - self.h_limits[0])
		new = [self.ref_pos[0] + dx, self.ref_pos[1] + dy]
		
		if new == self.ref_pos:
			return 1

		self.ref_pos = new

		self.backup_ref_node()

		if self.update_timeout:
			g.timeout_remove(self.update_timeout)
			self.update_timeout = 0
		self.update()
		
		return 1
Beispiel #3
0
	def size_allocate(self, alloc):
		new = (alloc.width, alloc.height)
		if self.last_alloc == new:
			return
		self.last_alloc = new
		assert self.window
		#print "Alloc", alloc.width, alloc.height
		pm = g.gdk.Pixmap(self.surface.window, alloc.width, alloc.height, -1)
		self.surface.window.set_back_pixmap(pm, False)
		self.pm = pm

		if self.update_timeout:
			g.timeout_remove(self.update_timeout)
			self.update_timeout = 0
		self.update()
Beispiel #4
0
	def destroyed(self, widget):
		self.view.remove_display(self)
		for s in self.signals:
			self.disconnect(s)
		if self.update_timeout:
			g.timeout_remove(self.update_timeout)
			self.update_timeout = 0

		#del self.selection
		del self.view
		del self.parent_window
		del self.ref_node
		del self.surface_layout
		del self.surface
		del self.scroll_adj
		del self.drawn
		del self.pm
Beispiel #5
0
		def destroyed(self):
			g.timeout_remove(self.update_timeout)
			rox.app_options.remove_notify(options_update)