author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 24 Dec 2014 14:16:19 +0100 | |
changeset 24 | 6c74dd51bff4 |
parent 23 | 38ee47dbd976 |
child 28 | 1bd3d147cd77 |
permissions | -rw-r--r-- |
18 | 1 |
"{ Package: 'stx:goodies/libcairo' }" |
2 |
||
3 |
"{ NameSpace: Cairo }" |
|
4 |
||
5 |
SimpleView subclass:#TextExampleView |
|
6 |
instanceVariableNames:'cr updater' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'Cairo-Examples' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!TextExampleView methodsFor:'accessing-dimensions'! |
|
14 |
||
15 |
preferredExtent |
|
16 |
||
17 |
^400 @ 400 |
|
18 |
||
19 |
"Created: / 17-06-2012 / 22:37:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
20 |
! ! |
|
21 |
||
22 |
!TextExampleView methodsFor:'redrawing'! |
|
23 |
||
24 |
redraw |
|
25 |
||
26 |
| | |
|
27 |
||
28 |
self clippingRectangle: |
|
29 |
(Smalltalk::Rectangle left:1 top:1 width:self width height:self height). |
|
30 |
cr isNil ifTrue:[ |
|
31 |
cr := self cairo. |
|
32 |
]. |
|
33 |
||
34 |
self font: (Font family: 'Helvetica' face: 'medium' style: 'italic' size: 32). |
|
35 |
self displayString: 'Hello world!!' x: 10 y: 40. |
|
36 |
||
37 |
cr fontFaceFamily: 'Helvetice' slant: Cairo::FontSlant FONT_SLANT_ITALIC weight: Cairo::FontWeight FONT_WEIGHT_NORMAL. |
|
38 |
cr fontSize: 42. |
|
39 |
||
40 |
cr moveToX: 10 y: 82. |
|
41 |
cr showText: 'Hello World!!' |
|
42 |
||
43 |
"Created: / 16-06-2012 / 23:25:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
44 |
! |
|
45 |
||
46 |
redrawX: x y: y width: w height: h |
|
47 |
||
48 |
self redraw |
|
49 |
||
50 |
"Created: / 17-06-2012 / 21:33:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
51 |
! ! |
|
52 |
||
53 |
!TextExampleView class methodsFor:'documentation'! |
|
54 |
||
23
38ee47dbd976
Added version_HG to make Mercurial happy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18
diff
changeset
|
55 |
version_HG |
38ee47dbd976
Added version_HG to make Mercurial happy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18
diff
changeset
|
56 |
^ '$Changeset: <not expanded> $' |
18 | 57 |
! ! |