Hello guys. I am developing an app where I have a layout object with a CHILD which is a bitmap object. What I want to do is to read the current width and height of the layout object so that I can set the equivalent size of the bitmap.
I tried to use the IIntuition->GetAttrs but didn't work that good
- ULONG layoutres;
- int layoutwidth;
- layoutres = IIntuition->GetAttrs( objects[OID_LAYOUT_Pic],
- CHILD_MinWidth, &layoutwidth,
- TAG_DONE );
- IDOS->Printf( "layout data! %ld", layoutwidth );
The above code returns something like
layout data! -2063585277
Do you have any clue on how to do that?
No, it doesn't. It returns nothing because CHILD_MinWidth is an attribute which can only be set, not get. The value of layoutwidth remains unchanged. What you print is the contents of an uninitialized variable.
Please describe what you want to do. Changing the size of a bitmap in your main program and then drawing it into the GUI is not the object oriented way one would use in a BOOPSI / ReAction environment. If you want to have a scalable bitmap inside a layout group which automatically adjusts its size according to the window size, you should make a small custom BOOPSI gadget which you add to the layout in place of the bitmap. The gadget's methods can then adjust the bitmap size and draw it inside its context and not "from the outside".
I can create an example for you tomorrow.