Cabbage Logo
Back to Cabbage Site

Getting the parent of an object

Hey Rory,

I was trying this morning to see if I could get the parent for an object. I tried the following:

SParent cabbageGet “mywid”, “parent”

But I get nothing…

Am I doing something wrong? Or is this not available?

I’m not sure this identifier is actually exposed. I don’t have time to test right now but will do later today. I’ll let you know…

Thanks, I was hoping to see if there is a way that I could recreate the cabbageCreate code from traversing the list of objects returned from cabbageGetWidgetChannels. The tricky part is getting the widget type, but I’ve got a workaround in the works.

It won’t take much to expose both type() and parent() as they are both already defined for internal use. But I won’t get to it this evening. It will be tomorrow morning before I get this working.

This is great, Rory! Maybe introspection on a Cabbage gui will be possible!!!

I actually got around to doing that just now. The following should work now. Both of these are obviously i-rate as they simply can’t change.

SType cabbageGet "widgetName", "type"
SParent cabbageGet "widgetName", "parent"

Let me know if this works Ok for you. It worked in my simple tests, but I didn’t really push it.

Cool, I’ll let you know tonight when I get home. I really appreciate your willingness to listen to us and your promptness in getting things done!

This software would be nothing without the input from its users. :stuck_out_tongue_winking_eye:

Rory, this is better than Christmas for an eight year old who is getting his first Luke Skywalker “Action Figure” (or maybe he would rather have Han)! Thank you! Both work, and considering the simplicity of their function, I doubt much hardcore testing will be required.

1 Like