Page 2 of 2

Re: Want to use TextGadget with multiline. How to get height

Posted: Tue Dec 16, 2014 11:38 pm
by IdeasVacuum
Hi Shardik you are absolutely right of course, that line shouldn't be there for cross-platform code :oops:
You should never claim cross-platform capability without testing on all 3 platforms
Disagree! If the code only uses PB's cross-platform functions, that should be good enough for the title - whether any code works as intended needs to be tested in context with the rest of the app anyway, and that is in the hands of the poster being helped.

Re: Want to use TextGadget with multiline. How to get height

Posted: Wed Dec 17, 2014 8:59 am
by Shardik
IdeasVacuum wrote:
You should never claim cross-platform capability without testing on all 3 platforms
Disagree! If the code only uses PB's cross-platform functions, that should be good enough for the title - whether any code works as intended needs to be tested in context with the rest of the app anyway, and that is in the hands of the poster being helped.
Unfortunately I found out that a lot of examples - whose posters claim them to be cross-platform - are in reality not working correctly cross-platform, even if only using official PB functions. This is a problem inherent to PureBasic: it's simply not possible to obtain an identical behavior because the wrapped API functions of the different platforms solve similar problems often very differently...

Therefore I would advise to never claim an example as cross-platform without having tested it on all 3 platforms (even if the example doesn't use any API function). I would prefer a remark that your example SHOULD be cross-platform because of using only native PB functions! Then this would be a hint to the original poster to carefully test the example on all his targeted platforms...:wink:

Re: Want to use TextGadget with multiline. How to get height

Posted: Thu Dec 18, 2014 3:07 pm
by TI-994A
Shardik wrote:...I would advise to never claim an example as cross-platform without having tested it on all 3 platforms (even if the example doesn't use any API function). I would prefer a remark that your example SHOULD be cross-platform because of using only native PB functions! Then this would be a hint to the original poster to carefully test the example on all his targeted platforms...:wink:
Hi Shardik. You're absolutely correct, although I've been guilty of the same. But, I do indicate the platforms on which the code has been tested, and I do try to make it a point of indicating the should clause in the post. :lol:

Re: Want to use TextGadget with multiline. How to get height

Posted: Thu Dec 18, 2014 3:09 pm
by TI-994A
Kukulkan wrote:The TextGadget does word-wrap - what is fine for me. But it looks like I have to know the height before setting the text...

Is there a way to find out, how big the gadget height has to be to cover all the text? I need it cross-platform!
Hi Kukulkan. I just posted a function to auto-size text gadgets over in the Tricks 'n' Tips forum. It utilises only native PureBasic functions, and has been tested on Windows and OSX. Perhaps it might work for you.

AutoSize() for text gadgets

:)