1
0
mirror of https://github.com/lxsang/Diya-API.git synced 2024-12-27 03:48:21 +01:00
Diya-API/Diya/DiyaWidget.class.st
2022-03-21 22:39:52 +01:00

49 lines
779 B
Smalltalk

Class {
#name : #DiyaWidget,
#superclass : #Diya2DNode,
#instVars : [
'style',
'extent'
],
#category : #'Diya-Widgets'
}
{ #category : #'instance creation' }
DiyaWidget class >> fromStyle: aStyle [
^self new style: aStyle; yourself
]
{ #category : #accessing }
DiyaWidget >> applyStyle [
self subclassResponsibility
]
{ #category : #geometry }
DiyaWidget >> extent: size [
extent := size.
dirty := true.
]
{ #category : #initialization }
DiyaWidget >> initialize [
super initialize.
self style: DiyaDefaultStyle new.
]
{ #category : #accessing }
DiyaWidget >> style [
^ style
]
{ #category : #accessing }
DiyaWidget >> style: anObject [
style := anObject.
self applyStyle.
]
{ #category : #accessing }
DiyaWidget >> update [
self applyStyle.
^ true
]