Mercurial > pyntnclick
diff gamelib/gamescreen.py @ 217:146cec58ddd8
Highlight detailed view close button
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Thu, 26 Aug 2010 20:26:41 +0200 |
parents | eb101b6fb3dd |
children | 3cedc4f95925 |
line wrap: on
line diff
--- a/gamelib/gamescreen.py Thu Aug 26 20:02:02 2010 +0200 +++ b/gamelib/gamescreen.py Thu Aug 26 20:26:41 2010 +0200 @@ -6,7 +6,6 @@ from albow.layout import Row from albow.palette_view import PaletteView from albow.screen import Screen -from albow.resource import get_font from pygame import Rect, mouse from pygame.color import Color from pygame.locals import BLEND_ADD @@ -16,7 +15,7 @@ from hand import HandButton from popupmenu import PopupMenu, PopupMenuButton from state import initial_state, Item, handle_result -from widgets import MessageDialog, BoomLabel +from widgets import MessageDialog, BoomButton class InventoryView(PaletteView): @@ -122,12 +121,11 @@ self.state = screen.state self.border_width = 5 self.border_color = (0, 0, 0) - self.close = BoomLabel('Close', font=get_font(20, 'Vera.ttf')) - self.close.bg_color = (0, 0, 0) + # parent only gets set when we get added to the scene + self.close = BoomButton('Close', self.close_but, screen) self.add(self.close) - self.close.mouse_down = self.close_but - def close_but(self, e): + def close_but(self): self.parent.clear_detail() def set_image_rect(self, rect):