Groups and children

Discuss GUI programming with the RapaGUI plugin here
Post Reply
GMKai
Posts: 158
Joined: Mon Feb 15, 2010 10:58 am

Groups and children

Post by GMKai »

Is there a way to get to now during runtime what children are existing?

Code: Select all

<statusbar>
				<item id="first" width="20"/>
				<item id="second"/>
			</statusbar>
How can Statusbar examined to get to know the count and ID of it's children?
GMKai
Posts: 158
Joined: Mon Feb 15, 2010 10:58 am

Re: Groups and children

Post by GMKai »

preliminary

Code: Select all

r = moai.HaveObject(id$)
might give a "global" answer,
is there a way to iterating over a group to look up only direct children?
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Groups and children

Post by plouf »

you can do "indirectly"
i.e. if you manual set naming id based in numbers and use strstr
example here status bar items id are "status_1" "status_2" and "status_3"

Code: Select all

	For i=1 To 4
		DebugPrint(moai.HaveObject("status_"..StrStr(i)))
  Next 
but wahts the point ? since status bar items are fixed during initialization and cannot changed after ?

p.s. maybe another "indirect" way is to examine window XML file ?
Christos
GMKai
Posts: 158
Joined: Mon Feb 15, 2010 10:58 am

Re: Groups and children

Post by GMKai »

The indirect way via gui-definition is very nice.

To still go the runtime-way, this should help:

Code: Select all

r = moai.Get(id,"Class") 
It helps to select an apropriate setter for an object
Post Reply