Create Widget and display it pure c++

I am not 100% sure what you are asking, but where is posx saved? Maybe it is geting initialised to 0 each time.