#Include "crt.bi"
#Include "inc/iup.bi"

sub _init_ constructor
  IupOpen(0,0)
end sub

sub _exit_ destructor
  IupClose()
end sub

Function help_cb cdecl()as Integer
  return IUP_CLOSE
End Function

'
' main
'
Dim As Ihandle Ptr dlg = IupFontDlg()

IupSetAttribute(dlg, "COLOR", "128 0 255")
IupSetAttribute(dlg, "VALUE", "Times New Roman, Bold 20")
IupSetAttribute(dlg, "TITLE", "IupFontDlg Test")
IupSetCallback(dlg, "HELP_CB", Cast(Icallback,@help_cb))

IupPopup(dlg, IUP_CURRENT, IUP_CURRENT)

if (IupGetInt(dlg, "STATUS")) Then
  printf(!"OK\n")
  printf(!"VALUE(%s)\n", IupGetAttribute(dlg, "VALUE"))
  printf(!"COLOR(%s)\n", IupGetAttribute(dlg, "COLOR"))
Else
  printf("CANCEL\n")
End If

IupDestroy(dlg)

