[futurebasic] Re: [FB] Changing a window's id value

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2003 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Tue, 23 Sep 2003 10:53:41 +0200

Robert Purves wrote:
> 
> On Tuesday, September 23, 2003, Bernie Wylde wrote:
> 
>> After creating a window, is it possible to change that window's id 
>> without closing it and re-building it from scratch with the new id?
> 
> 
> 
> 
> // requires Appearance runtime
> local mode
> local fn ChangeWndID( oldWndID as long, newWndID as long )
> '~'1
> dim wRefCon as ^^FBwindowDescription
> dim as WindowRef  @ wRef
> 
> get window oldWndID, wRef
> if ( wRef ) then wRefCon = fn GetWRefCon( wRef )
> if ( wRefCon) then wRefCon..FBwRef = newWndID
> end fn
> 
> 
> window 1, "The First Window"
> fn ChangeWndID( 1, 2 )
> window 1, "Another Window"
> window 2
> 
> do
> HandleEvents
> until 0
> 

It should be safer to use _clear_ local mode above because wRefCon 
might end up holding a random value.

Alain