[futurebasic] Re: [FB] Preventing data browser ItemNotificationCallbacks

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2005 : Group Archive : Group : All Groups

From: Bernie <fblist@...>
Date: Mon, 11 Apr 2005 12:06:32 +0100
Robert P wrote:

> Bernie wrote:
>> I have two windows. One contains graphical objects, the other has a 
>> data browser which lists the objects by name. When I click on an 
>> object, its name is selected in the DB and selecting an item in the 
>> DB selects the object.
>> OK, when I click the object, I select its name in the browser with:
>> 	ignore = fn SetDataBrowserSelectedItems(browser, 1, @itemID, 
>> _kDataBrowserItemsAssign)
>> Unfortunately, this generates a _kDataBrowserItemSelected message in 
>> my ItemNotificationCallback and er... selects the object.
>> Any ideas how I can prevent this inefficient action?
>
> From your description, it seems that either the objects are, or the 
> DataBrowser is, smart enough not to repeat the selection cycle in an 
> infinite loop. If the 'inefficiency' is merely inferred from examining 
> your code or tracing the function calls, a defensible option would be 
> to leave everything as it is.
>
> If,on the other hand, you have visible flickering, or an unacceptable 
> slowness in selecting (say) 100 objects at once, consider removing all 
> code that selects a clicked object *directly*. Allow your objects to 
> become selected only by the indirect route, via 
> SetDataBrowserSelectedItems and the ItemNotificationCallback.

There's no infinite loop or flicker. It's just that clicking an object 
is the most sluggish part of my app. The object list used to be a list 
box but replacing it with a browser is noticably slower: List box = 13 
ticks, Browser = 25 ticks.

I need to take a serious look at my code.

Thanks
Bernie