Hi Charles,
Another iup demo.
#define IUP_TITLE "TITLE"
%IUP_CLOSE = -3
%IUP_ERROR = 1
enum { IUP_DRAW_FILL, IUP_DRAW_STROKE, IUP_DRAW_STROKE_DASH }
typedef struct Ihandle_ {}
Ihandle_ Ihandle
typedef int (*Icallback)(Ihandle*)
typedef struct _IdrawCanvas {}
_IdrawCanvas IdrawCanvas
! IupOpen Lib "iup.dll" (sys argc,argv) as sys
! IupCreate Lib "iup.dll" (string cname) as sys
! IupSetAttributes Lib "iup.dll" (sys ih,string strz) as sys
! IupAppend Lib "iup.dll" (sys ih, child) as sys
! IupRefresh Lib "iup.dll" (sys ih)
! IupSetCallback Lib "iup.dll" (sys ih,string sname, sys func) as sys
! IupShow Lib "iup.dll" (sys ih) as sys
! IupShowXY Lib "iup.dll" (Ihandle *ih, sys x, sys y) as sys
! IupSetFocus Lib "iup.dll" (sys ih) as sys
! IupRecordInput Lib "iup.dll" (string *filename, sys mode) as sys
! IupPlayInput Lib "iup.dll" (string *filename) as sys
! IupMainLoop Lib "iup.dll" () as sys
! IupImageLibOpen Lib "iup.dll" () as sys
! IupLoopStep Lib "iup.dll" () as sys
! IupLoopStepWait Lib "iup.dll" () as sys
! IupMainLoopLevel Lib "iup.dll" () as sys
! IupClose Lib "iup.dll" ()
! IupFlush Lib "iup.dll" ()
! IupExitLoop Lib "iup.dll" ()
! IupUpdate Lib "iup.dll" (Ihandle *ih)
! IupUpdateChildren Lib "iup.dll" (Ihandle *ih)
! IupRedraw Lib "iup.dll" (Ihandle *ih, sys children)
! IupRefresh Lib "iup.dll" (Ihandle *ih)
! IupRefreshChildren Lib "iup.dll" (Ihandle *ih)
! IupMapFont Lib "iup.dll" (string *iupfont) as string
! IupUnMapFont Lib "iup.dll" (string *driverfont) as string
! IupHelp Lib "iup.dll" (string url) as sys
! IupLoad Lib "iup.dll" (string *filename) as string
! IupLoadBuffer Lib "iup.dll" (string *buffer) as string
! IupVersion Lib "iup.dll" () as string
! IupVersionDate Lib "iup.dll" () as string
! IupVersionNumber Lib "iup.dll" () as sys
! IupSetLanguage Lib "iup.dll" (string *lng)
! IupGetLanguage Lib "iup.dll" () as string
! iupDrawCreateCanvas Lib "iup.dll" (Ihandle *ih) as sys
! iupDrawKillCanvas Lib "iup.dll" (sys *dc)
! iupDrawFlush Lib "iup.dll" (sys *dc)
! iupDrawUpdateSize Lib "iup.dll" (sys *dc)
! iupDrawGetSize Lib "iup.dll" (sys *dc, *w, *h)
! iupDrawLine Lib "iup.dll" (sys *dc, x1, y1, x2, y2, byte r, g, b, sys style)
! iupDrawRectangle Lib "iup.dll" (sys *dc, x1, y1, x2, y2, byte r, g, b, sys style)
! iupDrawArc Lib "iup.dll" (sys *dc, x1, y1, x2, y2, double a1, a2, byte r, g, b, sys style)
! iupDrawPolygon Lib "iup.dll" (sys *dc, *points, count, byte r, g, b, sys style)
! iupDrawText Lib "iup.dll" (sys *dc, string *text, sys len, x, y, byte r, g, b, string *font)
! iupDrawImage Lib "iup.dll" (sys *dc, string *name, sys make_inactive, x, y, *img_w, *img_h)
! iupDrawSetClipRect Lib "iup.dll" (sys *dc, x1, y1, x2, y2)
! iupDrawResetClip Lib "iup.dll" (sys *dc)
! iupDrawRectangleInvert Lib "iup.dll" (sys *dc, x1, y1, x2, y2)
! iupDrawParentBackground Lib "iup.dll" (sys *dc)
Function quit_cb() as sys
Function = IUP_CLOSE
End Function
Sub AddChild(sys *parent, *child)
IupAppend parent,child
IupRefresh parent
End Sub
Function Create (string Value ,Attr ,sys parent) as sys
sys hwnd
hWnd = IupCreate(Value)
if hwnd
if Len(Attr)
IupSetAttributes(hwnd,Attr)
End if
if parent
AddChild parent,hwnd
End if
Return hwnd
End if
end function
sys canvas, width, height
Function Main() as sys
IupOpen(0,0)
win = Create("dialog","TITLE=IUP*TEST*PETER, SIZE=300x200",0)
iupShowXY *win,380,180
canvas = IupDrawCreateCanvas *win
iupDrawGetSize *canvas, *width, *height
iupDrawRectangle *canvas, 10, 10, 40, 40, 255, 0, 0, 0
iupDrawRectangle *canvas, 50, 10, 90, 40, 255,255,0, 1
iupDrawRectangle *canvas, 100,10, 140,40, 255,0,255, 2
iupDrawLine *canvas, 0, 100, &width, 100, 0,255,0, 2
iupDrawFlush *canvas
iupMainLoop()
iupDrawKillCanvas *canvas
iupClose()
End Function
Main()