I’m seeing issues with the control sizes on my Pi 3, 4 and 5. Basically, the control is too small to fit all the text properly on Buttons and Labels. When I build for Windows, Mac or Linux it’s fine. The issue is only on my Raspberry Pi’s. Anyone seen this and hopefully have a fix?
Please see the following for the ongoing discussion and some screen shots.
Set the control font to 12 and it will fit the defaut size. I believe xojo soomehow doesn’t really set the correct size (system default is probably 12 but xojo defines 14).
I do subclass the controls and set #if targetArm And TargetLinux then
Self.FontSize = 12 #endif
RaiseEvent Opening
I just manually set 3 controls on my test code to FontSize = 12 and they display correctly. Obviously it does’t make sense to do this manually, and I’m not sure how subclass the controls. I’m assuming simple code put somewhere in the project will handle all the controls, but I don’t know what that is or where to put it. I did try cut and paste of your suggestion and it didn’t work. I’m sure I didn’t put it in the proper place or use correctly.
There is a trick to make it work. Run the program with sudo.
On Raspberry Pi, running the program with the following command ignores global settings on Raspberry Pi:
./position
Running the program with sudo privileges allows some code, like window position, control size, etc. to work
sudo ./position
The problem with sudo, is that your program is granted administrative privileges and has total control over the computer. Programs running on the Raspberry Pi are now using virtual environments to protect the Raspberry Pi Operating System.
I have to compile the program on my Windows computer, and then copy the executables and libraries over to the Raspberry Pi to make sure the program runs, and is protected, the way that I want.
Hope this helps
Edit:
The proper way to run on a Raspberry Pi is to create a virtual environment, install dependencies, and run the program. Xojo doesn’t do this. The next time you want to run the program, restart the virtual environment, and run the Xojo program.
Yes, your right, the text is too large. The control also has changed. It seems to have issues with the border around the control. Do both of these issues appear on the computer you are testing? Just curious