[futurebasic] Tiger window group problems

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

From: Bernie <fblist@...>
Date: Fri, 20 May 2005 20:22:43 +0100
Just had a devil of a job installing Tiger. In the end, I had to do a  
clean install before it'd work. Anyway, window grouping is now being  
a bit of a er pane. These calls have stopped working on my machine:

fn RepositionWindow(w2, w1, _kWindowCascadeOnParentWindow)
fn ActivateWindow(w1, _false)
BringToFront(w2)

In the example, window 1 should be deactivated and window 2 should be  
created to the bottom right of window 1 and brought to the front. Can  
someone confirm that this is an OS feature rather than my machine?

Thanks
Bernie


'----------
include "Tlbx CarbonEvents.incl"

#define WindowGroupRef as pointer // to OpaqueWindowGroupRef
#define WindowGroupAttributes as UInt32
begin enum
_kWindowGroupAttrSelectAsLayer    = (1 << 0)
_kWindowGroupAttrMoveTogether     = (1 << 1)
_kWindowGroupAttrLayerTogether    = (1 << 2)
_kWindowGroupAttrSharedActivation = (1 << 3)
_kWindowGroupAttrHideOnCollapse   = (1 << 4)
end enum
toolbox fn CreateWindowGroup(WindowGroupAttributes inAttributes,  
WindowGroupRef outGroup) = OSStatus
toolbox fn SetWindowGroupParent(WindowGroupRef inGroup,  
WindowGroupRef inNewGroup) = OSStatus
toolbox fn SetWindowGroup(WindowRef inWindow, WindowGroupRef  
inNewGroup) = OSStatus

toolbox fn ActivateWindow(WindowRef inWindow, Boolean inActivate) =  
OSStatus

'~'<

local mode
local fn BuildWindows
'~'1
dim as Rect             @ r
dim as WindowGroupRef   @ wGroupRef
dim as WindowRef        @ w1, w2
dim as WindowClass      @ wc
dim as WindowAttributes @ wa
dim as OSStatus           ignore
'~'1
ignore = fn CreateWindowGroup(0, @wGroupRef)
'~'<
SetRect(r, 0, 50, 400, 350)
wc = _kDocumentWindowClass
wa =  
_kWindowStandardDocumentAttributes_kWindowStandardHandlerAttribute_kWind 
owCompositingAttribute_kWindowLiveResizeAttribute

ignore = fn CreateNewWindow(wc, wa, @r, w1)

ignore = fn SetWindowGroup(w1, wGroupRef)

SetWTitle(w1, "Window 1")
ignore = fn SetThemeWindowBackground(w1,  
_kThemeActiveDialogBackgroundBrush, _true)
ignore = fn RepositionWindow(w1, 0, _kWindowAlertPositionOnMainScreen)

ShowWindow(w1)
ignore = fn ActivateWindow(w1, _true)
'~'<
ignore = fn CreateNewWindow(wc, wa, @r, w2)

ignore = fn SetWindowGroup(w2, wGroupRef)

SetWTitle(w2, "Window 2")
ignore = fn SetThemeWindowBackground(w2,  
_kThemeActiveDialogBackgroundBrush, _true)
ignore = fn RepositionWindow(w2, w1, _kWindowCascadeOnParentWindow)

ignore = fn ActivateWindow(w1, _false)
ShowWindow(w2)
BringToFront(w2)
ignore = fn ActivateWindow(w2, _true)
'~'<
end fn

fn BuildWindows

RunApplicationEventLoop()
'----------