Ejemplo n.º 1
0
	def __init__(self):
		self.ns = Nurses_Station(1,"Carla Espinosa",self)
		self.gladefile = "gui/nurse_station.glade"
		self.builder = gtk.Builder()
		self.builder.add_from_file(self.gladefile)
		#self.wTree = gtk.glade.XML(self.gladefile)
		self.builder.connect_signals(self)
		self.window = self.builder.get_object("main_window")
		self.window.show_all()
		self.window.fullscreen()
		self.ns.setDaemon(True)
		self.ns.start()
Ejemplo n.º 2
0
class Nurses_Station_GUI:
	def __init__(self):
		self.ns = Nurses_Station(1,"Carla Espinosa",self)
		self.gladefile = "gui/nurse_station.glade"
		self.builder = gtk.Builder()
		self.builder.add_from_file(self.gladefile)
		#self.wTree = gtk.glade.XML(self.gladefile)
		self.builder.connect_signals(self)
		self.window = self.builder.get_object("main_window")
		self.window.show_all()
		self.window.fullscreen()
		self.ns.setDaemon(True)
		self.ns.start()
	
	def alarm(self, bed):
		gobject.idle_add(self.do_alarm, bed)
	
	def do_alarm(self,bed):
		# get alarm dialog
		dlg = self.builder.get_object("alarm_popup")
		# set text
		dlg.set_markup("<span size='xx-large'>Alarm on Bed #%s</span>" % bed)
		# if not visible, make visible
		dlg.show_all()
	
	def on_main_window_destroy(self, widget):
		gtk.main_quit()
		self.ns.stop = True
		quit()
	
	def on_alarm_popup_close(self, widget, data):
		# get alarm dialog
		dlg = self.builder.get_object("alarm_popup")
		# hide it
		dlg.hide()
	
	def on_alarm_popup_response(self, widget, data):
		self.on_alarm_popup_close(widget, data)