本文整理汇总了C++中Container::Children方法的典型用法代码示例。如果您正苦于以下问题:C++ Container::Children方法的具体用法?C++ Container::Children怎么用?C++ Container::Children使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Container
的用法示例。
在下文中一共展示了Container::Children方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResizeTimeOut
void Container::ResizeTimeOut(void *data, XtIntervalId * /*id*/)
{
Container *obj = (Container *)data;
int h4 = obj->Parent()->Height();
Dimension h1, h2, h3;
if (obj->NumChildren())
{
Dimension max_height;
MotifUI **children = (MotifUI **)obj->Children();
int i;
XtWidgetGeometry preferred;
max_height = 0;
for (i = 0; i < obj->NumChildren(); i++)
{
if (XtIsManaged(children[i]->BaseWidget()))
{
XtQueryGeometry(children[i]->BaseWidget(), NULL, &preferred);
if ((h1 = preferred.height) > max_height)
{
max_height = h1;
break;
}
}
}
Position y;
if (max_height)
XtVaGetValues(children[0]->BaseWidget(), XmNy, &y, NULL);
else
y = 0;
h1 = max_height + (2 * y);
}
else
XtVaGetValues(obj->_workArea, XmNheight, &h1, NULL);
XtVaGetValues(obj->_clipWidget, XmNheight, &h2, NULL);
XtVaGetValues(obj->_w, XmNheight, &h3, NULL);
h3 = h3 - h2 + h1;
if (h2 != h1)
{
if (h4 > (int)h3)
h3 = h4;
else if (obj->NumChildren() == 0)
return;
h4 = h3;
}
else if (h4 <= (int)h3)
return;
XtVaSetValues(obj->_w, XmNheight, h4, NULL);
obj->Refresh();
XtVaGetValues(obj->_w, XmNheight, &h3, NULL);
if (h3 != h4)
XtAppAddTimeOut(obj->appContext, 500, ResizeTimeOut, obj);
}