
#include once "inc/iup.bi"
#include once "inc/iupimglib.bi"

sub _init_ constructor
  IupOpen(0,0)
  ' init image resources
  IupImageLibOpen()
end sub

sub _exit_ destructor
  IupClose()
end sub

'
' main
'
dim as integer l
dim as IHandle ptr VBox=IupVBox(NULL)
dim as IHandle ptr Labels(IUP_BR)

' get images from the iupimglib
for i as integer = IUP_ACTIONCANCEL to IUP_BR
  Labels(i)=IupLabel(NULL)
  IupSetAttribute(Labels(i),"IMAGE",ImgNames(i))
  IupSetAttribute(Labels(i),"TIP",ImgNames(i)) 
next

' create frames with image labels
for b as integer = 0 to 6
  dim as IHandle ptr Box=IupHBox(NULL)
  for i as integer=0 to 7 
    IupAppend(Box,IupFrame(Labels(l))):l+=1 
    if i<7 then IupAppend(Box,IupFill())
  next
  IupAppend(VBox,Box)
  if b<6 then IupAppend(VBox,IupFill())
next
' show the dialog
IupShowXY(IupSetAttributes(IupDialog(VBox),"TITLE=IupImgLib"),IUP_CENTER,IUP_CENTER)
IupMainLoop()








