1 # Try colors -- display all 256 possible colors, with their color index
6 from stdwinevents
import *
12 stdwin
.setdefwinsize(NCOLS
* stdwin
.textwidth('12345'), \
13 NROWS
* stdwin
.lineheight() * 3)
14 w
= stdwin
.open('TestColors')
17 type, window
, detail
= stdwin
.getevent()
22 w
.change((0,0), (10000, 10000))
24 width
, height
= w
.getwinsize()
26 for row
in range(NROWS
):
27 for col
in range(NCOLS
):
28 color
= row
*NCOLS
+ col
30 p
= col
*width
/NCOLS
, row
*height
/NROWS
31 q
= (col
+1)*width
/NCOLS
, \
37 p
= p
[0] , p
[1]+ d
.lineheight()