use linkish labels

svn: r5663
This commit is contained in:
Don Allingham 2006-01-04 00:02:29 +00:00
parent 4a4e310948
commit 9b191aacdc

View File

@ -149,6 +149,8 @@ class FamilyView(PageView.PageView):
eventbox.add(label) eventbox.add(label)
eventbox.set_visible_window(False) eventbox.set_visible_window(False)
eventbox.connect('button-press-event',self.button_press,handle) eventbox.connect('button-press-event',self.button_press,handle)
eventbox.connect('enter-notify-event',self.enter_text,handle)
eventbox.connect('leave-notify-event',self.leave_text,handle)
eventbox.show() eventbox.show()
self.child.attach(eventbox,3,4,self.row,self.row+1, self.child.attach(eventbox,3,4,self.row,self.row+1,
@ -161,6 +163,21 @@ class FamilyView(PageView.PageView):
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1: if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1:
self.dbstate.change_active_handle(handle) self.dbstate.change_active_handle(handle)
def enter_text(self,obj,event,handle):
label = obj.child
label.set_text('<span foreground="blue" underline="single">%s</span>' %
self.get_name(handle))
label.set_use_markup(True)
def leave_text(self,obj,event,handle):
label = obj.child
label.set_text('<span underline="single">%s</span>' %
self.get_name(handle))
label.set_use_markup(True)
def make_enter_notify(self,handle):
return lambda x: self.enter_text(x,handle)
def write_parents(self,family_handle): def write_parents(self,family_handle):
family = self.dbstate.db.get_family_from_handle(family_handle) family = self.dbstate.db.get_family_from_handle(family_handle)
self.write_person(_('Father'),family.get_father_handle()) self.write_person(_('Father'),family.get_father_handle())