QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Has the behaviour of PtSetResources() changed? |
Ref. No. |
QNX.000004834 |
Category(ies) |
Development |
Issue |
I have noticed that there is a change in behaviour of the PtSetResources() function between Photon 1.12 and 1.13.
Looking at the following code segment: x09{... code to set local_area structure elements: pos.x, pos.y, size.h, size.w x09} x09PtSetArg (&widget_args[0], Pt_ARG_AREA, &local_area, 0) ; x09int result = PtSetResources (widget, 1, widget_args) ;
In Photon 1.13, PtSetResources returns -1 if all the elements of local_area are identical to the values that were set on a previous invocation of PtSetResources. In Photon 1.12, setting the area exactly to its previous value was accepted without error.
Does this behavior match what you see in the code for function PtSetResources?
|
Solution |
The code has changed, and for various reasons, the explanation in the docs hasn't changed. Looking at the source code, basically what it does is check to see if the resource is different than the one being provided. If it isn't different, it returns a zero, because nothing was changed. -1 isn't necessarily an error, it just means that no work was done (in this case, because it wasn't necessary)
|
|