Update of /cvsroot/pythoncard/PythonCard/samples/tictactoe
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21141
Modified Files:
tictactoe.py tictactoe.rsrc.py
Log Message:
switched to Image and mouseUp handlers
Index: tictactoe.rsrc.py
===================================================================
RCS file: /cvsroot/pythoncard/PythonCard/samples/tictactoe/tictactoe.rsrc.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** tictactoe.rsrc.py 10 May 2004 05:02:45 -0000 1.7
--- tictactoe.rsrc.py 28 Jul 2004 07:12:49 -0000 1.8
***************
*** 34,54 ****
{ 'type':'StaticText', 'name':'staticTurn', 'position':( 150, 400 ), 'size':(100, 30), 'text': '', 'alignment':'center', 'backgroundColor':'white' },
! { 'type':'ImageButton', 'name':'btn0', 'position':( 20, 20 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'ImageButton', 'name':'btn1', 'position':( 140, 20 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'ImageButton', 'name':'btn2', 'position':( 260, 20 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'ImageButton', 'name':'btn3', 'position':( 20, 140 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'ImageButton', 'name':'btn4', 'position':( 140, 140 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'ImageButton', 'name':'btn5', 'position':( 260, 140 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'ImageButton', 'name':'btn6', 'position':( 20, 260 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'ImageButton', 'name':'btn7', 'position':( 140, 260 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'ImageButton', 'name':'btn8', 'position':( 260, 260 ), 'size':(-2,-2), 'file':'empty.gif'}
]
}
--- 34,54 ----
{ 'type':'StaticText', 'name':'staticTurn', 'position':( 150, 400 ), 'size':(100, 30), 'text': '', 'alignment':'center', 'backgroundColor':'white' },
! { 'type':'Image', 'name':'btn0', 'position':( 20, 20 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'Image', 'name':'btn1', 'position':( 140, 20 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'Image', 'name':'btn2', 'position':( 260, 20 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'Image', 'name':'btn3', 'position':( 20, 140 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'Image', 'name':'btn4', 'position':( 140, 140 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'Image', 'name':'btn5', 'position':( 260, 140 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'Image', 'name':'btn6', 'position':( 20, 260 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'Image', 'name':'btn7', 'position':( 140, 260 ), 'size':(-2,-2), 'file':'empty.gif'},
! { 'type':'Image', 'name':'btn8', 'position':( 260, 260 ), 'size':(-2,-2), 'file':'empty.gif'}
]
}
Index: tictactoe.py
===================================================================
RCS file: /cvsroot/pythoncard/PythonCard/samples/tictactoe/tictactoe.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** tictactoe.py 5 May 2004 16:53:48 -0000 1.19
--- tictactoe.py 28 Jul 2004 07:12:49 -0000 1.20
***************
*** 179,188 ****
return 0
! def on_mouseClick(self, event):
# make sure that we only handle a mouseClick for
# the ImageButtons on the playfield
if self.isPlayfieldButton(event.target):
btnName = event.target.name
! print "bg1 mouseClick handler", btnName
pos = int(btnName[3])
#print event.target.getName(), 'clicked'
--- 179,188 ----
return 0
! def on_mouseUp(self, event):
# make sure that we only handle a mouseClick for
# the ImageButtons on the playfield
if self.isPlayfieldButton(event.target):
btnName = event.target.name
! print "bg1 mouseUp handler", btnName
pos = int(btnName[3])
#print event.target.getName(), 'clicked'
***************
*** 195,201 ****
# play a beep or do some other warning, a dialog would be too much
! def on_btn0_mouseClick(self, event):
btnName = event.target.name
! print "btn0 mouseClick handler", btnName
pos = int(btnName[3])
#print event.target.getName(), 'clicked'
--- 195,201 ----
# play a beep or do some other warning, a dialog would be too much
! def on_btn0_mouseUp(self, event):
btnName = event.target.name
! print "btn0 mouseUp handler", btnName
pos = int(btnName[3])
#print event.target.getName(), 'clicked'
|