Hi,
I'm struggling creating a tab control using "fn
CreateTabsControl(...)". Probably something wrong with my tabEntry
array. The code below runs but the tab control is inactive.
Uncommenting the lines, tabEntry.name(..) = fn CFSTR(...), makes it
crash. I've searched the dev site but can't find an example.
Any help?
TIA
Bernie
'----------
include "Tlbx HiView.Incl"
include "Tlbx Carbon Controls.INCL"
dim as ControlTabEntry tabEntry(1)
dim as Rect @ r
dim as WindowRef @ w
dim as HiViewRef @ c
dim as OSStatus ignore
SetRect(r, 100, 100, 600, 400)
ignore = fn CreateNewWindow(_kDocumentWindowClass,
_kWindowStandardDocumentAttributes_kWindowStandardHandlerAttribute, @r,
w)
SetWTitle(w, "Create Tab Control")
tabEntry.icon.contentType(0) = _kControlContentTextOnly
'tabEntry.name(0) = fn CFSTR("Tab 1")
tabEntry.enabled(0) = _true
tabEntry.icon.contentType(1) = _kControlContentTextOnly
'tabEntry.name(1) = fn CFSTR("Tab 2")
tabEntry.enabled(1) = _true
SetRect(r, 60, 100, 260, 240)
ignore = fn CreateTabsControl(w, @r, _kControlTabSizeSmall,
_kControlTabDirectionNorth, 2, @tabEntry(0), c)
ShowWindow(w)
RunApplicationEventLoop
'----------