[futurebasic] Re: [FB] DBData ?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2008 : Group Archive : Group : All Groups

From: Brian Stevens <bstevens33@...>
Date: Sat, 19 Jan 2008 12:28:13 -0700
On Jan 19, 2008, at 11:47 AM, Steve wrote:

> Bernie,
> How do you update a browser with new data, once it has already been  
> initialized in a NIB window ?

I use an earlier version of Bernie's DB code but not DBData  
specifically, so I can't give you specifics for it. However, in my  
code the general method is to clear the databrowser by passing the  
ControlRef of the browser to an fn like the one shown below. Next re- 
add the rows (and columns if needed) which just does an FN  
AddDataBrowserItems to load the itemIDs. This all assumes (in my  
case) that the data array used to populate the itemIDs has already  
been updated to reflect the changes by the user to the browser

HTH---Brian S.

local fn ClearDataBrowser(browser as ControlRef)
dim as Handle   itemH
//dim as pointer  itemP
dim as OSStatus OSStatus

itemH = fn NewHandle(0)
//itemP = [itemH]
long if itemH
OSStatus = fn GetDataBrowserItems(browser, _kDataBrowserNoItem,  
_true , _kDataBrowserItemAnyState, itemH)
long if OSStatus == _noErr
OSStatus = fn RemoveDataBrowserItems(browser, 0, fn GetHandleSize 
(itemH)\Sizeof(DataBrowserItemID), #[itemH], _nil)
end if
end if
end fn

Brian S.