author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 05 Apr 2016 10:00:57 +0100 | |
changeset 77 | cdf856e78998 |
parent 29 | 6ba06265e543 |
child 88 | 9d51db2ba641 |
permissions | -rw-r--r-- |
18 | 1 |
"{ Package: 'stx:goodies/libcairo' }" |
2 |
||
3 |
"{ NameSpace: Cairo }" |
|
4 |
||
5 |
SimpleView subclass:#TextExampleView |
|
28
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
6 |
instanceVariableNames:'' |
18 | 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 |
||
28
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
26 |
self font: (Font family: 'Helvetica' face: 'medium' style: 'italic' size: 32). |
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
27 |
self displayString: 'Hello world!!' x: 10 y: 40. |
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
28 |
|
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
29 |
self redrawWithCairo |
18 | 30 |
|
28
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
31 |
"Created: / 16-06-2012 / 23:25:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
32 |
"Modified: / 27-12-2014 / 00:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
33 |
! |
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
34 |
|
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
35 |
redrawWithCairo: cr |
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
36 |
|
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
37 |
self clippingBounds: nil. |
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
38 |
|
18 | 39 |
|
40 |
self font: (Font family: 'Helvetica' face: 'medium' style: 'italic' size: 32). |
|
41 |
self displayString: 'Hello world!!' x: 10 y: 40. |
|
42 |
||
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
43 |
cr fontFaceFamily: 'Helvetice' slant: Cairo::FontSlant CAIRO_FONT_SLANT_ITALIC weight: Cairo::FontWeight CAIRO_FONT_WEIGHT_NORMAL. |
18 | 44 |
cr fontSize: 42. |
45 |
||
46 |
cr moveToX: 10 y: 82. |
|
47 |
cr showText: 'Hello World!!' |
|
48 |
||
28
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
49 |
"Created: / 27-12-2014 / 00:36:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
29
6ba06265e543
Bindinge updated to recent Cairo version.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
50 |
"Modified: / 28-12-2014 / 22:13:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
18 | 51 |
! |
52 |
||
53 |
redrawX: x y: y width: w height: h |
|
54 |
self redraw |
|
55 |
||
56 |
"Created: / 17-06-2012 / 21:33:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
28
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
57 |
"Modified: / 27-12-2014 / 00:37:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
18 | 58 |
! ! |
59 |
||
60 |
!TextExampleView class methodsFor:'documentation'! |
|
61 |
||
23
38ee47dbd976
Added version_HG to make Mercurial happy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18
diff
changeset
|
62 |
version_HG |
38ee47dbd976
Added version_HG to make Mercurial happy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18
diff
changeset
|
63 |
^ '$Changeset: <not expanded> $' |
18 | 64 |
! ! |
28
1bd3d147cd77
Added utility methods to SimpleView...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
24
diff
changeset
|
65 |