From cadff464e38e5e50db17d0c3ee57304b976063ad Mon Sep 17 00:00:00 2001 From: Fox Date: Mon, 4 Apr 2016 21:02:15 -0700 Subject: [PATCH] wip streamlined_get_set stuff --- src/pop/extensions/streamlined_get_set.moon | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pop/extensions/streamlined_get_set.moon b/src/pop/extensions/streamlined_get_set.moon index be6d72b..29213aa 100644 --- a/src/pop/extensions/streamlined_get_set.moon +++ b/src/pop/extensions/streamlined_get_set.moon @@ -6,6 +6,7 @@ import sub, len from string path = sub ..., 1, len(...) - len "/extensions/streamlined_get_set" element = require "#{path}/elements/element" +text = require "#{path}/elements/text" element.__base.position = (x, y) => if x or y @@ -54,3 +55,11 @@ element.__base.margin = (m) => -- __call: (...) -> -- print ... -- } + +text.__base.text = (text) => + if text + return @setText text + else + return @getText! + +-- size probably needs redefine here, elemental size won't fall through...or will it?