Back to index

gcompris  8.2.2
Public Member Functions | Public Attributes
bargame.Gcompris_bargame.prof_button Class Reference

List of all members.

Public Member Functions

def __init__
def set_prof
def event_play

Public Attributes

 board
 prof_item

Detailed Description

Definition at line 507 of file bargame.py.


Constructor & Destructor Documentation

def bargame.Gcompris_bargame.prof_button.__init__ (   self,
  board,
  root,
  prof_image 
)

Definition at line 508 of file bargame.py.

00508 
00509     def __init__(self, board, root, prof_image):
00510       self.board = board
00511 
00512       self.prof_item = root.add(
00513         gnomecanvas.CanvasPixbuf,
00514         y = 230
00515         )
00516       bounds = self.prof_item.get_bounds()
00517       self.prof_item.set(x  = ((gcompris.BOARD_WIDTH - bounds[2]-bounds[0])/2 - 90))
00518 
00519       self.prof_item.connect("event",self.event_play)
00520       # This item is clickeable and it must be seen
00521       self.prof_item.connect("event", gcompris.utils.item_event_focus)


Member Function Documentation

def bargame.Gcompris_bargame.prof_button.event_play (   self,
  item,
  event 
)

Definition at line 525 of file bargame.py.

00525 
00526     def event_play(self, item, event):
00527       if ((event.type != gtk.gdk.BUTTON_PRESS) or
00528           (event.button != 1)):
00529         return False
00530 
00531       # if answer button has been clicked, that play the human turn
00532       if self.board.last_played == -1 :
00533         self.board.machine_play()
00534         return True
00535 
00536       return False
00537 
def bargame.Gcompris_bargame.prof_button.set_prof (   self,
  prof_image 
)

Definition at line 522 of file bargame.py.

00522 
00523     def set_prof(self, prof_image):
00524       self.prof_item.set(pixbuf = gcompris.utils.load_pixmap(prof_image))


Member Data Documentation

Definition at line 509 of file bargame.py.

Definition at line 511 of file bargame.py.


The documentation for this class was generated from the following file: