running the code below I get a strange behavior, in the sense that the searchFor function, as it were, freezes the app until it returns the result: the flying pizza shows up and Activity Monitor shows Memory usage rising from 30MB to 500MG each time the function is called.
Now, the folderitems I’m passing are all PDF files, some of them small, and some around 400KB.
Apart from freezing the app, another strange thing is that if no match is found, I have to wait for several seconds, while if a match is found, the result is pretty immediate. One would say that the code is running in a synchronous way.
So, is the way I’m using this process all right, or am I overlooking something obvious?
Suggestions welcome. Thanks.
BTW: I know that the function below is flagged as “deprecated”; but it seems newer related declares are still beta.
Load the folderitem
after the page is shown, I click a pushbutton with this code:
Sub Action() Handles Action
dim result as Integer
if HTMLViewer1.htmlSearchFor("Hello",false,false,false) then
result = 1
result = 0
[code]Public Function HTMLsearchFor(extends v as HTMLViewer, text as String, forward as Boolean, caseSensitive as Boolean, wrap as Boolean) as Boolean
#if TargetCocoa then
declare function searchFor lib “Cocoa” selector “searchFor:direction:caseSensitive:wrap:” (obj_id as Integer, inText as CFStringRef, inForward as Boolean, inCaseSensitive as Boolean, inWrap as Boolean) as Boolean
Return searchFor(v.Handle, text, forward, caseSensitive, wrap)