Skip navigation.
Home
The QNX Community Portal

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

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

Read-only archive of qnx.gui (Creating graphical applications within a GUI environment, such as Photon or PhAB) at inn.qnx.com

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

Postby 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
Kevin Stallard
 

RE: What is the difference between a widget

Postby maschoen » Thu Jul 05, 2007 3:09 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?
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm


Return to qnx.gui

Who is online

Users browsing this forum: No registered users and 1 guest