This is the
iup_buttons demo for Windows and Linux using bc9.
' bc9 IUP Button Example
#include <iup.h>
DIM AS Ihandle PTR win, horzbox, btn1, btn2, btn3
SUB Btn1_clicked
PRINT "BUTTON 1 Event"
END SUB
SUB Btn2_clicked
PRINT "BUTTON 2 Event"
END SUB
SUB Btn3_clicked
PRINT "BUTTON 3 Event"
END SUB
IupOpen(NULL,NULL)
win = IupCreate("dialog")
IupSetAttributes(win, E"TITLE=\qTest Dialog\q, SIZE=300x")
horzbox = IupCreate("hbox")
IupSetAttributes(horzbox, "GAP=5")
btn1 = IupCreate("button")
IupSetAttributes(btn1, "TITLE=Button1, EXPAND=HORIZONTAL")
btn2 = IupCreate("button")
IupSetAttributes(btn2, "TITLE=Button2, EXPAND=HORIZONTAL")
btn3 = IupCreate("button")
IupSetAttributes(btn3, "TITLE=Button3, EXPAND=HORIZONTAL")
IupAppend(horzbox, btn1)
IupAppend(horzbox, btn2)
IupAppend(horzbox, btn3)
IupAppend(win, horzbox)
IupSetCallback(btn1, "ACTION", (Icallback)Btn1_clicked)
IupSetCallback(btn2, "ACTION", (Icallback)Btn2_clicked)
IupSetCallback(btn3, "ACTION", (Icallback)Btn3_clicked)
IupShow(win)
IupMainLoop()
IupClose()
Note: Will try to get XP themes working with bc9. (James, any direction with this?)
E:\bc9>bc9 iup_buttons.bas
BCX-32: BASIC to C/C++ Translator by Kevin Diggins (c) 1999-2012
BCX-32 Version 9.0.0.7 (2012/03/23)
[Lines In: 41] [Lines Out: 227] [Statements: 36] [Time: 0.14 sec's]
BCX translated iup_buttons.bas to iup_buttons.C For a C Compiler
E:\bc9>gcc iup_buttons.C -IC:/iupwin/iup/include -LC:/iupwin/iup -liup -o iup_buttons.exe
E:\bc9>iup_buttons
BUTTON 1 Event
BUTTON 2 Event
BUTTON 3 Event
E:\bc9>bc9 iup_buttons.bas -nix
BCX-32: BASIC to C/C++ Translator by Kevin Diggins (c) 1999-2012
BCX-32 Version 9.0.0.7 (2012/03/23)
[Lines In: 41] [Lines Out: 150] [Statements: 36] [Time: 0.15 sec's]
BCX translated iup_buttons.bas to iup_buttons.C For a C Compiler
E:\bc9>
jrs@laptop:~/B4A/bc9$ gcc iup_buttons.C -I/usr/include/iup -liup -o iup_buttons
jrs@laptop:~/B4A/bc9$ ./iup_buttons
BUTTON 1 Event
BUTTON 2 Event
BUTTON 3 Event
jrs@laptop:~/B4A/bc9$
I updated the source with the bc9 method of embedding escape characters (\q = double quote) into a string.
IupSetAttributes(win, E"TITLE=\qTest Dialog\q, SIZE=300x")
I was able to get XP theme support working with a .manafest file. I would prefer this was included in the bc9 build.