Fun and testing elements conform to new API
This commit is contained in:
@@ -19,17 +19,11 @@ type AnalogClock struct {
|
||||
// NewAnalogClock creates a new analog clock that displays the specified time.
|
||||
func NewAnalogClock (newTime time.Time) (element *AnalogClock) {
|
||||
element = &AnalogClock { }
|
||||
element.Core, element.core = core.NewCore(element)
|
||||
element.Core, element.core = core.NewCore(element.draw)
|
||||
element.core.SetMinimumSize(64, 64)
|
||||
return
|
||||
}
|
||||
|
||||
// Resize changes the size of the clock.
|
||||
func (element *AnalogClock) Resize (width, height int) {
|
||||
element.core.AllocateCanvas(width, height)
|
||||
element.draw()
|
||||
}
|
||||
|
||||
// SetTime changes the time that the clock displays.
|
||||
func (element *AnalogClock) SetTime (newTime time.Time) {
|
||||
if newTime == element.time { return }
|
||||
|
||||
Reference in New Issue
Block a user