' ************************************************
' * Demo of AIR's Cocoa Objects Library (libcol) *
' ************************************************
$MODULE "cocoa.inc"
const win_width = 600
const win_height = 400
const button_width = 90
widgets as enum
txtFld
button
colorButton
combo
checkbox
label
edit
end enum
sub btnClick(sender as id)
dim fname$,a$
fname$ = mainWin.openDialog("bas:c:mm")
if len(fname$) then
mainWin.setText(txtFld,fname$)
a$ = LoadFile$(fname$)
mainWin.setText(edit,a$)
end if
end sub
Global mainWin("AIR Cocoa Test Window", win_width, win_height) as FORM
Cocoa_Init()
with mainWin
.newEntry(txtFld, "Testing AIR's Cocoa Library with MBC", 16, 20, win_width-122, 26, akWidth)
.newButton(button, "Load", win_width-100, 20, button_width, 26, akRight, btnClick)
.newButton(colorButton, "Color", win_width-100, 50, button_width, 26, akRight)
.newCombo(combo, 16, 50, 210, 26)
.newCheck(checkbox, "Check Box 1", 240, 50, 100, 26)
.newLabel(label, "This is a Label", 360, 50, 100, 26)
.newEdit(edit,"", 16, 96, 480, 280,akWidth | akHeight)
.Add(combo, "Apples:Oranges:Peaches", "Oranges")
.setText(edit, "Hello, World!")
end with
Cocoa_Run()