in the following simple code which use the IUP GUI lib, I use IupSetAttribute who has a delcaration in "FreeBASIC-1.05.0-win32\inc\IUP\iup.bi" as
Code: Select all
declare sub IupSetAttribute(byval ih as Ihandle ptr, byval name as const zstring ptr, byval value as const zstring ptr)
Code: Select all
IupSetAttribute(dlg, "TITLE", "600")
Code: Select all
IupSetAttribute(dlg, "TITLE", str(wid))
Code: Select all
dim as string t = str(wid)
IupSetAttribute(dlg, "TITLE", t)
Code: Select all
IupSetfAttribute(dlg, "TITLE", "%d", wid)
Code: Select all
IupSetAttribute(dlg, "TITLE", str(wid))
Code: Select all
#include once "IUP/iup.bi"
Function main() as Integer
Dim as Ihandle ptr dlg, button,vbox
dim wid as integer= 600 ' this value maybe calculated by some function, so I don't know its string format in advance
IupOpen(0, 0)
button = IupSetAttributes(IupLabel("I'm a label"), "SIZE=100x")
vbox = IupVbox(button, 0)
dlg = IupDialog(vbox)
' ~ IupSetAttribute(dlg, "TITLE", "600") ' this works
IupSetAttribute(dlg, "TITLE", str(wid)) ' this set title to questionary mark
IupShowXY(dlg, IUP_CENTER, IUP_CENTER)
IupMainLoop()
IupClose()
return 0 'EXIT_SUCCESS
End Function
main()