Pt_ARG_SCROLLAREA_POS_X & Y not working?

This relates to my previous post regarding the PtScrollContainer widget. I am trying to find out how much a PtScrollContainer widget has been scrolled.

For example, if you have a widget outside the visible area of the PtScrollContainer scroll bars will appear to you can scroll the visible area to your widget. Its this scroll amount that I want to find out.

I have found an argument that I think should provide me with this.

Pt_ARG_SCROLLAREA_POS_X & Pt_ARG_SCROLLAREA_POS_Y

I am using it like this.

int test = 0; PtGetResource (MyPtScrollContainer, Pt_ARG_SCROLLAREA_POS_X, test, 0); printf("X Scroll amount = %d\n", test);
But I always get the answer 0 (zero) regardless of how much u scroll.

Any one else tried using this? Am i using the correct ARG?

Thanks again all.

Have a look into PtGetResource() call again. You probably need to use &test or test as int *.

Thanks SmeeAgain, Unfortunately it still doesn’t work.

It won’t compile with *test

And I get a memory failure with &test.

Any other ideas?

Yet again I have been stupid, you were right SmeeAgain. I thought alittle more about what u said and realized that PtGetResource returns a pointer! So the code should be:

int *test = 0; PtGetResource (MyPtScrollContainer, Pt_ARG_SCROLLAREA_POS_X, &test, 0); printf("X Scroll amount = %d\n", test);

Thanks for the help :slight_smile: