Want to use TextGadget with multiline. How to get height?

Everything else that doesn't fall into one of the other PB categories.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

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

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Shardik
Addict
Addict
Posts: 2058
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

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

Post 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:
User avatar
TI-994A
Addict
Addict
Posts: 2698
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

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

Post 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:
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
TI-994A
Addict
Addict
Posts: 2698
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

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

Post 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

:)
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
Post Reply