Linux: Default Control Sizes

Hi,

I followed the instructions you can find at Xojo Developer Network to set the Default Control Sizes in Linux. This works fine only for my TextFields within Windows (all other RectControls are ignored, don’t know why), but if I replace the Window1 Parameter within the loop with a ContainerControl, it crashes without any information. I get the compiler error “Self ContainerControl) does not mean anything in a module method”. Please look at the attached sample Project.

Seems you have a shared method in a container so there’s indirection trying to map onto an instance of the container at runtime. If you try msgbox parent.name you get a better error message that a shared method can’t access container instance properties. But if you put it in a method native to the container Xojo knows the instance of the container created at runtime. I did the same for Window1 btw but don’t know if that was necessary.
I had to copy/paste and drag/drop everything from the binary project into a new project because I couldn’t compile the binary project on Ubuntu 16.04. Text works better for me because you can visually inspect everything looks ok with the project without opening it.
Another problem I ran into was textfiled open event firing too early for the container’s control count since the control was still opening. The Activate event for the container was what worked for me.
After this the project ran OK but on my system there wasn’t any an issue with control sizes for me to see the effect of the API call - they rendered OK to start with.

Thanks for your response Eric,
I did it also, but the app always terminates without any Debugger Error Message. Maybe you can share your modified project to compare.

Sorry, been busy. Will get onto it shortly.

Have a look at http://developer.xojo.com/override-system-class-default-values, it won’t help with existing controls in a project, but you can set new controls to your own size specification.