Code: Select all
#Include "d:/IUP/iup.bi"
#Include "Form.bas"
Type XForm
dlg as IHandle Ptr
label as IHandle Ptr
Declare Constructor
Declare Sub Show()
End Type
Constructor XForm()
label = IupLabel("Hello world from IUP.")
dlg = IupDialog(IupVbox(label,0))
IupSetAttribute(dlg, "SIZE","FULL")
IupSetAttribute(dlg, "TITLE", "Hello World!")
Print "Inside Form constructor..."
end constructor
sub XForm.Show()
IupShowXY(dlg, IUP_CENTER, IUP_CENTER)
Print "Showing the Form..."
end sub
Dim Form1 As XForm
IupOpen(0, 0)
Print "IupOpen..."
Form1.Show()
Print "Entering IupMainLoop..."
IupMainLoop()
Print "IupClose..."
IupClose()
'=============================================================================
'The following code works perfectly
'Dim dlg as IHandle Ptr
'Dim label as IHandle Ptr
'
'IupOpen(0, 0)
'label = IupLabel("Hello world from IUP.")
'dlg = IupDialog(IupVbox(label,0))
'IupSetAttribute(dlg, "SIZE","FULL")
'IupSetAttribute(dlg, "TITLE", "Hello World!")
'IupShowXY(dlg, IUP_CENTER, IUP_CENTER)
'IupMainLoop()
'IupClose()
'
'=============================================================================