Any way to speedup font/size change in text field?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tonymac
Posts: 23
Joined: Thu Jan 05, 2012 9:17 pm

Any way to speedup font/size change in text field?

Post by tonymac » Fri Nov 11, 2016 8:14 pm

On Android mobile devices...

OK I realize this is a lot of text in a text field (70,000 words, 400k plain text file size) but the process of changing the font or font size (set the textsize of field "Whatever" to 14) takes over 5 seconds. I guess this would not be so bad if I had a way to show a progressbar while this is going on. The user thinks things are frozen and continues to click on the button to change the font size of this text field.

Anybody got any ideas of things I might try?

Thanks.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Any way to speedup font/size change in text field?

Post by Klaus » Fri Nov 11, 2016 8:29 pm

Hi Tony,

I don't develop for mobile, but to be sure:
You do "lock/unlock screen" before and after setting the font/size, do you?


Best

Klaus

tonymac
Posts: 23
Joined: Thu Jan 05, 2012 9:17 pm

Re: Any way to speedup font/size change in text field?

Post by tonymac » Fri Nov 11, 2016 8:50 pm

Yes I did set the lockscreen to TRUE. I did not make any difference in how long it took for the font size of a field to be changed.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Any way to speedup font/size change in text field?

Post by dunbarx » Fri Nov 11, 2016 9:50 pm

Hi.

Is this a mobil thing? It took me 8 ticks to set the textSize of a field of 70,000 words with locking.

Craig

tonymac
Posts: 23
Joined: Thu Jan 05, 2012 9:17 pm

Re: Any way to speedup font/size change in text field?

Post by tonymac » Sat Nov 12, 2016 4:21 am

Yes it takes (for me anyway) over 5 seconds for my Android app on a Samsung Note 4 to change the textsize of a field containing 70,000 words. I assume you are talking about it taking 8 ticks for you on a desktop?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Any way to speedup font/size change in text field?

Post by FourthWorld » Sat Nov 12, 2016 9:25 am

Can you show the code you're using to do this?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

tonymac
Posts: 23
Joined: Thu Jan 05, 2012 9:17 pm

Re: Any way to speedup font/size change in text field?

Post by tonymac » Sat Nov 12, 2016 7:43 pm

This is all I'm doing...

on mousedown
set the lockscreen to TRUE
if the textsize of field "TheText" = 12 then
set the textsize of field "TheText" to 14
else if the textsize of field "TheText" = 14 then
set the textsize of field "TheText" to 16
else if the textsize of field "TheText" = 16 then
set the textsize of field "TheText" to 18
else if the textsize of field "TheText" = 18 then
set the textsize of field "TheText" to 12
end if
set the lockscreen to FALSE
end mousedown

After clicking on a button with this script, it is executed and it take ~ 5 seconds to finish changing the font size of this field containing 70,000 words on my Android Samsung Note 4 phone.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Any way to speedup font/size change in text field?

Post by jmburnod » Sat Nov 12, 2016 8:12 pm

Hi tonymac,

Code: Select all

on mouseUp
   lock screen
   put the textsize of fld "theText"  into tSize
   if tSize = 18 then
      put 12 into tSize
   else
      add 2 to tSize
   end if
   set the textsize of fld "theText" to tSize
   unlock screen
end mouseUp
Best regards
Jean-Marc
https://alternatic.ch

tonymac
Posts: 23
Joined: Thu Jan 05, 2012 9:17 pm

Re: Any way to speedup font/size change in text field?

Post by tonymac » Sat Nov 12, 2016 9:23 pm

Thanks Jean-Marc for your suggestion however there was no improvement in the amount of time it took to change the font size.

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”