I'm trying to create a custom rpm gauge widget. everything looks fine when i test it by itself. But when i try to draw it at a different position in the parent window it seems to always draw using the origin of the window and not that of the widget no matter what x or y value i am passing to the constructor.
a printf() after calling the constructor confirmed that the widget "knows" the intended x and y.
Is this the default behavior ? i thought that the draw function uses the widgets 0,0 and not the window. do i need to explicitly call the x() and y() in the custom draw() function and apply transforms and/or offsets to correct this ?
Is this the default behavior ? i thought that the draw function uses the widgets 0,0 and not the window. do i need to explicitly call the x() and y() in the custom draw() function and apply transforms and/or offsets to correct this ?
I noticed that some drawing functions do not care about the current transform. I think fl_pie() is one of them. A fl_translate() call before it does not seem to affect the origin so i think will follow your method here by adding xo and yo to the parameters.
I did not know about the FLUID part so i will definitely explore that.Will check out Greg's widget too. sure there is a lot to learn there