Hide tooltip instantly?

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

Zax
Posts: 475
Joined: Mon May 28, 2007 10:12 am
Location: France
Contact:

Re: Hide tooltip instantly?

Post by Zax » Mon Apr 08, 2024 8:25 am

You are right Richard: working with a property is less time consuming than I thought. I redid the following test and the difference in execution time between the different methods is not significant for a few hundred iterations.

Now, regarding my tooltip problem, I admit that if the solution proposed by Jacque works, I will keep it without looking further, but it may take a little time because my bug did not appear very often.

Test script for un button:

Code: Select all

local gVar

on mouseUp
   local iterCount
   ask "Number of iterations:" with 10000
   if it is an integer then
      put it into iterCount
      set the Test of this stack to ""
      answer "Iterations:" && iterCount & cr & cr & "Variable:" && testVar(iterCount) && "ms" & cr & \
            "Function:" && testFunction(iterCount) && "ms" & cr & "Property:" && testProperty(iterCount) && "ms"
   end if
end mouseUp

function testVar pIterCount // local variable test
   local tStartTimer, tVar, tempVar
   put the milliseconds into tStartTimer
   repeat with i = 1 to pIterCount
      put i + 1 into tVar
      put tVar into tempVar
   end repeat
   return the milliseconds - tStartTimer
end testVar

function testFunction pIterCount // getter/setter function test
   local tStartTimer, tempVar
   put the milliseconds into tStartTimer
   repeat with i = 1 to pIterCount
      setValue i + 1
      put getValue() into tempVar
   end repeat
   return the milliseconds - tStartTimer
end testFunction

function getValue
   return gVar
end getValue

on setValue varValue
   put varValue into gVar
end setValue

function testProperty pIterCount // stack property test
   local tStartTimer, tempVar
   put the milliseconds into tStartTimer
   repeat with i = 1 to pIterCount
      set the Test of this stack to i + 1
      put the Test of this stack into tempVar
   end repeat
   return the milliseconds - tStartTimer
end testProperty

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”