What is the difference between a widget's area and extent?

bridged with qnx.gui
Post Reply
Kevin Stallard

What is the difference between a widget's area and extent?

Post by Kevin Stallard » Wed Jul 04, 2007 9:32 pm

They seem to be the same or closely related. But I don't understand the
differences.

The documentation says:

<Documentation Quote>
"The position and dimensions of the widget can be accessed or modified
simultaneously using the Pt_ARG_AREA resource provided by the widget.

The extent of a widget is a rectangle defined by the widget's position and
dimensions. It isn't normally calculated until the widget is realized; you
can force the widget to calculate its extent by calling PtExtentWidget(); to
force a widget and its children to calculate their extents, call
PtExtentWidgetFamily(). Once the extent is calculated, you can find out what
it is by getting the Pt_ARG_EXTENT resource or by calling PtWidgetExtent()."

</Documentation Quote>

Is there any point in which the area will differ from the extent? Why does
the extent have to be caluclated if the area is the same as the extent?

Thanks

Kevin

maschoen

RE: What is the difference between a widget

Post by maschoen » Thu Jul 05, 2007 3:49 pm

I've never noticed this interesting distinction before, but let me
hazard a guess.
If a (container) widget, contained another widget that was anchored in
a certain
way, the internal widget doesn't know its extent until the containing
widget's extent
is extent is calculated. Likewise, if the extent of the container
changes, the extent of
the internal widget also changes. You therefore could not change the
extent of the
internal widget yourself, it being dependent on the container.

But maybe you could change the areas of both widgets without affecting
the other?

Post Reply

Return to “qnx.gui”