On Mon, 31 Oct 2011 15:09:33 +1000 David Seikel <onef...@gmail.com>
wrote:

> So try this one instead.  It works.  B-)

Now here is a patch for text_class, it includes the last one.


Next I'll work on accessing edje parts in other groups, to set their
text and state at least.  Coz I need it, and coz raster said that's one
of the goals of lua script only groups.

The API I'm thinking of might look something like this -

edje.["my/group/name"].my_part.state.default[1.0].text.text = "Some
text.";

shown = edje.["edje/group/name"].my_part.state.default[1.0].visible;

edje.["my/group/name"].my_part.state:state_set("other_state", 1.0);

I've experimented with this a bit already.  There is a bit of a
problem.  The lua developers say that arrays start at one.  In reality -

Tables are associative arrays, that may have any type or value as a
key, except nil.

Tables with keys that are positive integers greater than 0 are
treated syntactically as arrays.  There are some functions that deal
with them that way.

Here's the kicker -

Tables with numeric keys that are equal to 0 only work sometimes.
Sometimes they are just "keys can be anything", and work fine.  Other
times lua thinks "Hey, this is an integer, and you can't have an
integer key of 0, coz arrays start at 1".  And btw, in lua 0 and 0.0
are the same.  There really is no integer type.

The reason why this is important - in the above examples of API, I used
"state.default[1.0]" coz "state.default[0.0]" or even
"state.default[0]" don't work.  And since edje state indexes are between
0.0, and 1.0, as well as the requirement for every part to have at
least "default 0.0", we gotta deal with zeros in a language that does
not like them.  So we gotta add 1.  sigh

Might be better off just treating them like strings,
state.default["0.0"].

-- 
A big old stinking pile of genius that no one wants
coz there are too many silver coated monkeys in the world.

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World&#153; now supports Android&#153; Apps 
for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to