DX: Any way to set child?

Sunday, May 18, 2008 by sViz | Discussion: DesktopX

I know you can query whether or not an object is a child with object.child. It basically returns true or false. I figured maybe the reverse was possible; being able to set object.child = true (or false) for an object, but so far no luck.

Anyone tried this and is it at all possible?

RomanDA
Reply #1 Sunday, May 18, 2008 7:04 PM
Not that i have seen.. its like there is a way from the standard menu to set the z-order to on-top, but not in the code. Can we get a list of things for the next release???
sViz
Reply #2 Sunday, May 18, 2008 10:07 PM
Bummer...that's frustrating. Looks like I'll have to create two sets of objects; children and not children, which is extremely impractical for what I want to do.   

PuterDudeJim
Reply #3 Sunday, May 18, 2008 10:47 PM
sViz, I am not sure as to what you are asking. There is a way to set parent/child relationships in DX. If you ask what I am thinking, it is easy. Elaborate on it a little.
ZubaZ
Reply #4 Sunday, May 18, 2008 11:07 PM
I think he wants to set a parent to a child or some such thing through a gadget/widget script live .. not in the builder.
sViz
Reply #5 Sunday, May 18, 2008 11:24 PM
I think he wants to set a parent to a child or some such thing through a gadget/widget script live .. not in the builder.


Correct.

Found a work around....woot! I'll post a streamlined version of the fix as soon as possible.
CerebroJD
Reply #6 Monday, May 19, 2008 1:38 AM
Isn't there a setParent method?
RomanDA
Reply #7 Monday, May 19, 2008 6:00 AM
Cool.. cant wait to see. sounds like something we need to add to the DesktopX.info Site!
sydneysiders
Reply #8 Monday, May 19, 2008 8:34 AM
I think he wants to


she    
ZubaZ
Reply #9 Monday, May 19, 2008 10:25 AM
I think he wants to
she


I knew that! Dagnabit!
RomanDA
Reply #10 Monday, May 19, 2008 10:35 AM
i did the same thing on the skincast.. i should never assume.. sorry sViz!
SirSmiley
Reply #11 Monday, May 19, 2008 1:42 PM
Was going to suggest the parent option last night but, there are a few things I've encountered using it.

If your cloned object isn't contained and you want to make it a contained child then you must remember to move it to within the dimensions of the container.
sViz
Reply #12 Monday, May 19, 2008 8:02 PM
i did the same thing on the skincast.. i should never assume.. sorry sViz!


No worries, DA (and Zubaz), at least you pronounced my nick right.


I guess I should clarify that setting or assigning a parent wasn't the problem. I can do that. The specific problem was setting object.child = "yes" or object.child = "no". The distinction was important because, as you know, that allows/disallows the child object to be visible outside the parent's boundaries.


sounds like something we need to add to the DesktopX.info Site!


I'll be sure to put it in the tutorial section on the site, because it requires a good deal of explaining.




For what it's worth:

My idea was, on dragfinish, depending on where I dropped an object, it would either:

1. create a new object, which was not a child

2. if I drop it on another object it would automatically set the parent and make it a child.


To create the object as a child I had to clone a template object which was already a child of another object and then just change the parent (I did this before with my eZbrowser). The problem was making it not a child after cloning.

I could set the parent to nothing but then, checking its properties, it was still set to child = "yes". So it was a child of nothing and it wasn't visible!

After fuddling around I decided to clone the clone again and see what happens....it worked. The 2nd clone, without a parent, was automatically set to child = "no"


Crazy, huh? Well, all in a day's work.
sViz
Reply #13 Wednesday, May 21, 2008 9:25 PM
The tut on this is now up on DesktopX.info....HERE

HAPTORK
Reply #14 Saturday, May 24, 2008 11:51 AM
You got it. Thanks for letting us know.

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01