Kamal 139 posts since
Oct 17, 2007
3.
Re: How to refer CalendarControl UI graphical child? Oct 3, 2008 7:27 AM

in response to:
RajivGu
Note that in your code
"{for one-graphic in cal.child do"
where "cal" is a CalendarControl.
Since the getter "child" could be null, you will get an error:
"Attempt to iterate over a container that might be null.".
You may use the following code instead:
{if-non-null child = cal.child then
{for one-graphic in cal.child do
...
}
}
However, the above code is not going to work either. Note that "child" here is a Layout, and it does not have the 'get' method or the 'for-loop-count' property nor a 'to-Iterator' method.
You should use "cal.graphical-children" to get the graphical children of a "Box".
The HBox, the original message referred, to is not a direct child of the CalendarControlUI. In my earlier response I said that you will have to do this search
recursively. In fact, even after doing that you may not get the HBox as the HBox may not yet be created or added to the graphical hierarchy. This is because the default implementation of the CalendarControl does not create a UI unless it is needed. So unless you attach the CalendarControl to a graphical hierarchy, it will not create the user interface object for it.