Forum > Beginners

Best practices for Multiplatform GUI portability

(1/5) > >>

Raul_ES:
Hello,  :)

I do really love Lazarus/FPC/CodeTyphon for it's powerfull set of components and it's multiplatform
capabilities but it really stress me sometimes when it comes to port the GUI of an application from one system to another.

For instance, I develop under BSD/GTK a program an when I switch to Ubuntu Linux/GTK or
Windows/Win64 (it's possible to use GTK with the same theme under Windows?) fonts are larger or smaller, they appear at a slightly different possition, the edit box heigth is different... aaaaarg it's difficult to keep coherence between all these platforms.
Surely I'm doing something or many few things wrong, probably basic ones. What I am missing?

I would like to hear about your experience in this matter and how you handle this odds. As sofware
developers with expertice you are, what kind of good engineering practices would you advice or recommend to a rookie?

thank you all,

Thaddy:
Mindset problem:

Widgetsets, be it Windows, GTKXXX, QtXXX or whatever always have a default design.  Lazarus tries (and succeeds) in keeping those default designs.
Do NOT try to change it, because you will change the experience that the user on those different platforms expect.
Usually it is only programmers that want everything to look the same... That's OK.... but then go all the way and make it look the same... ;D That's YOUR programming sikills.... >:(

Get it?

cpicanco:
Hi Raul_ES, do not be upset with the grumpy Thaddy. He is old. Just try to learn from the wise Thaddy, he is very experienced. And the wise Thaddy is right. What he was trying to say: changing defaults for cross-platform requires a lot of expertise and hard work.

Also, for now the easy to use LCL is (as far as I know) constrained to desktop. I am considering to move to fpGui... people say that it is better for cross-platform.

JD:
@Raul_ES

It is practically impossible when you use the native widgetsets on each platform to get the default Look-And-Feel. There will always be differences and don't count on those differences going away soon.

Best you can do IMHO is to use frames designed for each widgetset (think virtual environments like VirtualBox; a pain, I know but I've not found a better way). The frame that is loaded by the form will then be based on which widgetset is being used. The application will then look better at run time avoiding the native font problem, height of controls and so on.

If you keep the code to handle the events on the form, you'll be able to keep code duplication as low as possible.

Cheers and good luck,

JD

jmpessoa:


--- Quote --- ...keep the code to handle the events on the form...

--- End quote ---
O:-)   +1

Navigation

[0] Message Index

[#] Next page

Go to full version