15
|
1 |
"{ Package: 'stx:goodies/libcairo' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Cairo }"
|
|
4 |
|
|
5 |
SimpleView subclass:#ClockView
|
|
6 |
instanceVariableNames:'cr'
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'Cairo-Examples'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!ClockView class methodsFor:'instance creation'!
|
|
14 |
|
|
15 |
new
|
|
16 |
"return an initialized instance"
|
|
17 |
|
|
18 |
^ self basicNew initialize.
|
|
19 |
! !
|
|
20 |
|
|
21 |
!ClockView methodsFor:'redrawing'!
|
|
22 |
|
|
23 |
redraw
|
|
24 |
|
|
25 |
cr isNil ifTrue:[cr := self cairo].
|
|
26 |
|
|
27 |
cr paint: Color black.
|
|
28 |
cr moveToX: 30 y: 50.
|
|
29 |
cr fontFaceFamily: 'Times' slant: (Cairo::FontSlant FONT_SLANT_ITALIC) weight: 2.
|
|
30 |
cr fontSize: 30.
|
|
31 |
cr showText: 'Cairo in Smalltalk/X'.
|
|
32 |
cr paint: (Color red alpha: 0.5).
|
|
33 |
cr rectangleX: 10 y: 15 width: 150 height: 60.
|
|
34 |
cr fill.
|
|
35 |
cr paint: (Color red alpha: 0.75).
|
|
36 |
cr rectangleX: 10 y: 15 width: 150 height: 60.
|
|
37 |
cr stroke.
|
|
38 |
|
|
39 |
"Created: / 16-06-2012 / 23:25:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
40 |
! !
|
|
41 |
|
|
42 |
!ClockView class methodsFor:'documentation'!
|
|
43 |
|
|
44 |
version_SVN
|
|
45 |
^ '$Id:: $'
|
|
46 |
! !
|