Cairo__TextExampleView.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 20 Jun 2012 06:37:21 +0000
changeset 18 fae6edf1bdbd
child 23 38ee47dbd976
permissions -rw-r--r--
- Cairo::TextExampleView added:8 methods - stx_goodies_libcairo changed: #classNamesAndAttributes #extensionMethodNames #preRequisites - Cairo::ClockView changed: #preferredExtent - extensions ...

"{ Package: 'stx:goodies/libcairo' }"

"{ NameSpace: Cairo }"

SimpleView subclass:#TextExampleView
	instanceVariableNames:'cr updater'
	classVariableNames:''
	poolDictionaries:''
	category:'Cairo-Examples'
!


!TextExampleView class methodsFor:'instance creation'!

new
    "return an initialized instance"

    ^ self basicNew initialize.
! !

!TextExampleView methodsFor:'accessing-dimensions'!

preferredExtent

    ^400 @ 400

    "Created: / 17-06-2012 / 22:37:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!TextExampleView methodsFor:'redrawing'!

redraw

    |  |

    self clippingRectangle: 
        (Smalltalk::Rectangle left:1 top:1 width:self width height:self height).
    cr isNil ifTrue:[
        cr := self cairo.
    ].

    self font: (Font family: 'Helvetica' face: 'medium' style: 'italic' size: 32).
    self displayString: 'Hello world!!' x: 10 y: 40.

    cr fontFaceFamily: 'Helvetice' slant: Cairo::FontSlant FONT_SLANT_ITALIC weight: Cairo::FontWeight FONT_WEIGHT_NORMAL. 
    cr fontSize: 42.

    cr moveToX: 10 y: 82.
    cr showText: 'Hello World!!'

    "Created: / 16-06-2012 / 23:25:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

redrawX: x y: y width: w height: h

    self redraw

    "Created: / 17-06-2012 / 21:33:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!TextExampleView class methodsFor:'documentation'!

version_SVN
    ^ '$Id::                                                                                                                        $'
! !