Oxygen Basic

Information => Open Forum => Topic started by: JRS on January 09, 2013, 10:51:27 PM

Title: O2 / IUP
Post by: JRS on January 09, 2013, 10:51:27 PM
Peter,

I'm creating parallel threads on the AllBasic.INFO site showing BaCon and bc9 using IUP. If you have some spare time on your hands, could you do the O2 version of the demos for Windows?

John
Title: Re: O2 / IUP
Post by: Peter on January 10, 2013, 03:19:59 AM
Hi JRS,

Read here.

Code: [Select]
#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 a,b) 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" (char *filename, sys mode) as sys
! IupPlayInput        Lib "iup.dll" (char *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" (char *iupfont) as string
! IupUnMapFont        Lib "iup.dll" (char *driverfont) as string
! IupHelp             Lib "iup.dll" (string url) as sys
! IupLoad             Lib "iup.dll" (char *filename) as string
! IupLoadBuffer       Lib "iup.dll" (char *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" (char *lng)
! IupGetLanguage      Lib "iup.dll" () as string
! IupText             lib "iup.dll" (char *text)
! 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, char *text, sys len, x, y, byte r, g, b, char *font)
! iupDrawImage        Lib "iup.dll" (sys *dc, char *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)

sys canvas,font

Sub iText (sys x,y, string text, sys r,g,b)
    iupDrawText *canvas, text, len(text), x,y, r,g,b, 0
End Sub

IupOpen(0,0)
win = iupCreate "dialog"
iupSetAttributes win,"TITLE=INSANITY, SIZE=174x148"
iupShow win  
canvas = IupDrawCreateCanvas *win
iupDrawRectangle *canvas, 0,0, 244,238, 254,72,170, 1
iupDrawRectangle *canvas, 1,1, 243,237, 254,92,270, 1
iText 50,20, "SORRY MISTER IUP !",255,25,25
iText 80,100,"NO TIME !!",255,255,255
iText 20,120,"I GOT OWN STUPID WORKING.",255,255,100
iText 50,140,"AND THAT " + 500 + "x",55, 255, 10
iText 30,200,"THANK YOU FOR ENQUIRY",255,128,128
iupDrawFlush *canvas
IupMainLoop()
iupDrawKillCanvas *canvas
IupClose()
Title: Re: O2 / IUP
Post by: JRS on January 10, 2013, 05:25:07 AM
Thanks Peter for the code to get started with. I would like to use the IUP C header files as much as possible without redefinition in O2. I will try to get a O2 set of IUP example working once I finish with the bc9 (BCX fork) and ScriptBasic versions. I will chime in here from time to time with my progress/problems getting OxygenBasic working with IUP.

MrIup   :D

Title: Re: O2 / IUP
Post by: Peter on January 10, 2013, 10:44:09 PM
Hi JRS,

A new IUP header and some Demos.
Code: [Select]
include "iup.inc"

IupOpen(0,0)
IupShow(IupDialog(IupLabel("Hello World!")))
IupMainLoop()
IupClose()

Code: [Select]
include "iup.inc"
sys win

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(0,0)
win=IupCreate("dialog")
IupSetAttributes win, "TITLE= Test Dialog, 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)
IupSetFunction(btn1, Btn1_clicked)   'IupSetCallback crashed!
IupSetFunction(btn2, Btn2_clicked)   'IupSetCallback crashed!
IupSetFunction(btn3, Btn3_clicked)   'IupSetCallback crashed!
IupShow(win)
IupMainLoop()
IupClose()

Code: [Select]
include "iup.inc"

sys canvas,alpha,beta,ox=200,oy=140
single x,y,h

Sub Cone()
for alpha=0 to 360 step 8
    x = 100*cos(rad(alpha))
    y = sin(rad(alpha))*sin(rad(beta)) * 80
    h = 100*cos(rad(beta))
    iupDrawLine *canvas,ox,oy, ox+x,oy-(y-h), 255,255,255,1
next
End Sub

IupOpen(0,0)
win= iupCreate "dialog"
IupSetAttributes win,"TITLE=CONE,SIZE=300x200"
iupShow win  
canvas= IupDrawCreateCanvas *win
cone()
iupDrawFlush *canvas
iupMainLoop
iupDrawKillCanvas *canvas
iupDestroy win
iupClose

X
Title: Re: O2 / IUP
Post by: Peter on January 11, 2013, 02:33:39 AM
And so on
Code: [Select]
include "iup.inc"

IupOpen(0,0)
iupMessage "WARNING","Mayflies attack"
iupMainLoop() 
iupClose()

X
Title: Re: O2 / IUP
Post by: JRS on January 11, 2013, 05:46:54 AM
WOW!

Thank you Peter. This was exactly what I was looking for.
Title: Re: O2 / IUP
Post by: JRS on January 11, 2013, 07:20:16 AM
Peter,

Code: [Select]
IupSetFunction(btn1, Btn1_clicked)   'IupSetCallback crashed!
IupSetFunction(btn2, Btn2_clicked)   'IupSetCallback crashed!
IupSetFunction(btn3, Btn3_clicked)   'IupSetCallback crashed!

Just noticed that callbacks aren't working. I'm going to stop here until you guys figure out what the issue is.

FWIW: James Fuller posted as O2/IUP example a while back that had IupSetCallback() working.

Thanks for your help with the IUP on everything project.  :D

P.S. I would be happy to set you up an account on AllBasic.info if you like. Charles is already a member.

John
Title: Re: O2 / IUP
Post by: JRS on January 11, 2013, 09:26:24 AM
I have made some progress with the callback issue using James's definition.

Code: [Select]
' ! IupSetCallback      Lib "iup.dll" (sys ih, char *sname, sys func) as sys callback
! IupSetCallback      Lib "iup.dll" (sys ih,string sname, sys func) as sys

iup_buttons.o2bas
Code: [Select]
include "iup.inc"
sys win

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(0,0)
win=IupCreate("dialog")
IupSetAttributes win, "TITLE= Test Dialog, 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", @Btn1_clicked)
IupSetCallback(btn2, "ACTION", @Btn2_clicked)
IupSetCallback(btn3, "ACTION", @Btn3_clicked)
IupShow(win)
IupMainLoop()
IupClose()

(http://files.allbasic.info/O2/iup_buttons.png)

I'm getting exception when I click on any of the buttons.

(http://files.allbasic.info/O2/buterr.png)

It would be nice to have XP theme support in O2.   :o
Title: Re: O2 / IUP
Post by: Peter on January 11, 2013, 01:08:56 PM
Hi JRS,

more and better,  IupCallback does go!
Code: [Select]
include "iup.inc"

Sub WinExit()
  IupExitLoop
End Sub

sys dlg,lbl

IupOpen 0,0
dlg = iupCreate "dialog"
lbl = IupLabel "HELLO  MISTER  IUP !"
IupSetCallback dlg,"IUP_CLOSE", WinExit
IupAppend dlg, lbl
IupShow dlg
IupMainLoop
IupClose

X
Title: Re: O2 / IUP
Post by: JRS on January 11, 2013, 04:09:28 PM
Peter,

No luck with the new iup.inc file. Did you try the buttons example you posted that has a callback other than the IUP_CLOSE (works even without calling it)?

Code: OxygenBasic
  1. include "iup.inc"
  2. sys win
  3.  
  4. Sub Btn1_clicked()
  5.   PRINT "BUTTON 1 Event"
  6. End Sub
  7.  
  8. Sub Btn2_clicked()
  9.   PRINT "BUTTON 2 Event"
  10. End Sub
  11.  
  12. Sub Btn3_clicked()
  13.   PRINT "BUTTON 3 Event"
  14. End Sub
  15.  
  16. IupOpen(0,0)
  17. win=IupCreate("dialog")
  18. IupSetAttributes win, "TITLE= Test Dialog, SIZE=300x"
  19. horzbox = IupCreate("hbox")
  20. IupSetAttributes(horzbox, "GAP=5")
  21. btn1 = IupCreate("button")
  22. IupSetAttributes(btn1, "TITLE=Button1, EXPAND=HORIZONTAL")
  23. btn2 = IupCreate("button")
  24. IupSetAttributes(btn2, "TITLE=Button2, EXPAND=HORIZONTAL")
  25. btn3 = IupCreate("button")
  26. IupSetAttributes(btn3, "TITLE=Button3, EXPAND=HORIZONTAL")
  27. IupAppend(horzbox, btn1)
  28. IupAppend(horzbox, btn2)
  29. IupAppend(horzbox, btn3)
  30. IupAppend(win, horzbox)
  31. IupSetCallback(btn1,"ACTION",Btn1_clicked)
  32. IupSetCallback(btn2,"ACTION",Btn2_clicked)
  33. IupSetCallback(btn3,"ACTION",Btn3_clicked)
  34. IupShow(win)
  35. IupMainLoop()
  36. IupClose()
  37.  

What is strange is that the PRINT statements are firing before the main dialog shows and when I press a button I get the exception error I posted earlier. Is there a chance you are using a newer version of O2 then I am?

John
Title: Re: O2 / IUP
Post by: Peter on January 11, 2013, 05:11:36 PM
Hi JRS,

No crash here,  I found this little evil!
Try the new iup.inc. Report back.



X
Title: Re: O2 / IUP
Post by: JRS on January 11, 2013, 05:34:24 PM
I reinstalled a fresh copy of O2 A39 and used the above example with your latest iup.inc.

Same problem.

* PRINT dialogs fire on startup
* Exception dialog when any button is pressed.

Running XP. (latest updates)
Title: Re: O2 / IUP
Post by: Peter on January 11, 2013, 05:40:56 PM
Hi JRS,

I use this DLL.



X
Title: Re: O2 / IUP
Post by: JRS on January 11, 2013, 05:44:20 PM
I'll give that a try. Attached is the build code dump for the iup_buttons.o2bas that I'm having issues with on my laptop.



X
Title: Re: O2 / IUP
Post by: JRS on January 11, 2013, 05:52:26 PM
Nothing has changed with your Oxygen.dll.  :'(

Title: Re: O2 / IUP
Post by: Peter on January 11, 2013, 06:01:33 PM
Wrong WindowXP  :D

X
Title: Re: O2 / IUP
Post by: JRS on January 11, 2013, 06:25:48 PM
Are you saying I need to translate Win32 via Windows 7 (32 to 64 bit OS) to work?

I have Windows 7 64 bit in my other partition I normally reserve for 64 bit Windows testing. I'll give this a try there.

FWIW Many Windows users are still using XP on their (part time) PC when not using a mobile device.



Title: Re: O2 / IUP
Post by: JRS on January 11, 2013, 06:51:42 PM
Windows 7 (64 bit) doesn't work with the the same code I tried under XP. You must have a magical version of O2 that makes IUP listen to you.  ::)

I thought that maybe the iup.dll (MinGWGCCTDM) I had installed in the system32 directory was the issue. I renamed it so I was using the one you provided in the zip but still no change.

(http://files.allbasic.info/O2/buttons_win7.png)

(http://files.allbasic.info/O2/gxo2_error.png)
Title: Re: O2 / IUP
Post by: JRS on January 11, 2013, 08:44:00 PM
This is IUP working on XP using ScriptBasic and the extension module (wrapper) I wrote.

(http://files.allbasic.info/ScriptBasic/iup_buttons_win.png)

Code: [Select]
' IUP Button / Event Example

IMPORT iup.bas

SUB Btn1_clicked
  PRINT "BUTTON 1 Event\n"
END SUB

SUB Btn2_clicked
  PRINT "BUTTON 2 Event\n"
END SUB

SUB Btn3_clicked
  PRINT "BUTTON 3 Event\n"
END SUB

SUB Win_exit
  Iup::ExitLoop = TRUE
END SUB

Iup::Open()
win = Iup::Create("dialog")
Iup::SetAttributes(win, "TITLE=\"Test Dialog\", SIZE=300x")
horzbox = Iup::Create("hbox")
Iup::SetAttributes(horzbox, "GAP=5")
btn1 = Iup::Create("button")
Iup::SetAttributes(btn1, "TITLE=Button1, EXPAND=HORIZONTAL")
btn2 = Iup::Create("button")
Iup::SetAttributes(btn2, "TITLE=Button2, EXPAND=HORIZONTAL")
btn3 = Iup::Create("button")
Iup::SetAttributes(btn3, "TITLE=Button3, EXPAND=HORIZONTAL")
Iup::Append(horzbox, btn1)
Iup::Append(horzbox, btn2)
Iup::Append(horzbox, btn3)
Iup::Append(win, horzbox)
Iup::SetCallback(win,"CLOSE_CB",ADDRESS(Win_exit()))
Iup::SetCallback(btn1,"ACTION",ADDRESS(Btn1_clicked()))
Iup::SetCallback(btn2,"ACTION",ADDRESS(Btn2_clicked()))
Iup::SetCallback(btn3,"ACTION",ADDRESS(Btn3_clicked()))
Iup::Show(win)
Iup::MainLoop()
Iup::Close()

C:\scriptbasic\test>sbiup iup_buttons.sb
BUTTON 1 Event
BUTTON 2 Event
BUTTON 3 Event

C:\scriptbasic\test>

* sbiup.exe - Windows version of ScriptBasic that doesn't pop a console window like the console version scriba does.
Title: Re: O2 / IUP
Post by: Charles Pegge on January 11, 2013, 11:13:48 PM
Hi John and Peter,

In Oxygen your callback Subs should have the callback attribute, otherwise it will corrupt some of the registers used by IUP causing Exceptions.

I think this will resolve the problem.

Note wndproc() always requires this attribute because it is also called from outside of Oxygen.

Code: [Select]
sub Btn2_clicked() callback
  print "BUTTON 2 Event"
end sub

Charles
Title: Re: O2 / IUP
Post by: Peter on January 12, 2013, 12:17:34 AM
Thanks Charles,

We need a callback tutorial !  :D

Code: [Select]
include "iup.inc" 
sys win 
 
Sub Btn1_clicked() callback
  IupMessage "OKAY","BUTTON 1 Event" 
End Sub 
 
Sub Btn2_clicked() callback
  IupMessage "OKAY","BUTTON 2 Event" 
End Sub 
 
Sub Btn3_clicked() callback
  IupMessage "OKAY","BUTTON 3 Event" 
End Sub 
 
Sub Btn4_clicked() callback
  IupMessage "OKAY","BUTTON 4 Event" 
End Sub 

IupOpen 0,0 
win=IupCreate("dialog") 
IupSetAttributes win, "TITLE= Test Dialog, 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") 

btn4 = IupCreate("button") 
IupSetAttributes(btn4, "TITLE=Button4, EXPAND=HORIZONTAL") 

IupAppend(horzbox, btn1) 
IupAppend(horzbox, btn2) 
IupAppend(horzbox, btn3) 
IupAppend(horzbox, btn4) 

IupAppend(win, horzbox) 
IupSetCallback(btn1, "ACTION", Btn1_clicked) 
IupSetCallback(btn2, "ACTION", Btn2_clicked) 
IupSetCallback(btn3, "ACTION", Btn3_clicked) 
IupSetCallback(btn4, "ACTION", Btn4_clicked) 

IupShow win 
IupMainLoop 
IupClose 
Title: Re: O2 / IUP
Post by: Peter on January 12, 2013, 12:20:10 AM
Quote
You must have a magical version of O2 that makes IUP listen to you.
 

My Windows7 is by MicroSoft, yours is by Bill Gates  :D
Title: Re: O2 / IUP
Post by: Aurel on January 12, 2013, 12:36:06 AM
No ...your IUP is from BillyTheGate.. ;D
Or maybe you need proper ipiyipi.dll like me from Lua51...grr :D :D :D

X
Title: Re: O2 / IUP
Post by: Charles Pegge on January 12, 2013, 03:10:45 AM
You can also use external instead of callback

Or you can place all the callback subs inside an extern .. end extern block. Then you don't have to tag them individually. They are safe for the outside world to access.
Title: Re: O2 / IUP
Post by: Aurel on January 12, 2013, 06:04:20 AM
Quote
You can also use external instead of callback
well i don't know that ,so on this way will work any GUI wraper
created in dll...i will try HMG from xHarbour... ::)
Title: Re: O2 / IUP
Post by: Charles Pegge on January 12, 2013, 06:54:42 AM
These tags instruct the compiler to save extra registers: ebx esi and edi onto the stack at the start of a procedure, then pops them before returning.  This satisfies the stdcall and cdecl calling conventions. Internal Oxygen functions do not save these registers and assumes that the ebx register always references static/global variables and the run-time library. This saves significant processing time.

The same rules are applied to export procedures in a dll.
Title: Re: O2 / IUP
Post by: JRS on January 12, 2013, 09:28:19 AM
That didn't change anything for me. I'm still seeing the SUBs doing the PRINTs before the buttons dialog appears. If I click on any of the buttons I get an exception error dialog.

Code: OxygenBasic
  1. sys win
  2.  
  3. Sub Btn1_clicked() CALLBACK
  4.   PRINT "BUTTON 1 Event"
  5. End Sub
  6.  
  7. Sub Btn2_clicked() CALLBACK
  8.   PRINT "BUTTON 2 Event"
  9. End Sub
  10.  
  11. Sub Btn3_clicked() CALLBACK
  12.   PRINT "BUTTON 3 Event"
  13. End Sub
  14.  
  15. IupOpen(0,0)
  16. win=IupCreate("dialog")
  17. IupSetAttributes win, "TITLE= Test Dialog, SIZE=300x"
  18. horzbox = IupCreate("hbox")
  19. IupSetAttributes(horzbox, "GAP=5")
  20. btn1 = IupCreate("button")
  21. IupSetAttributes(btn1, "TITLE=Button1, EXPAND=HORIZONTAL")
  22. btn2 = IupCreate("button")
  23. IupSetAttributes(btn2, "TITLE=Button2, EXPAND=HORIZONTAL")
  24. btn3 = IupCreate("button")
  25. IupSetAttributes(btn3, "TITLE=Button3, EXPAND=HORIZONTAL")
  26. IupAppend(horzbox, btn1)
  27. IupAppend(horzbox, btn2)
  28. IupAppend(horzbox, btn3)
  29. IupAppend(win, horzbox)
  30. IupSetCallback(btn1,"ACTION",Btn1_clicked)
  31. IupSetCallback(btn2,"ACTION",Btn2_clicked)
  32. IupSetCallback(btn3,"ACTION",Btn3_clicked)
  33. IupShow(win)
  34. IupMainLoop()
  35. IupClose()
  36.  

Peter's version of PRINT doesn't help either.

Code: OxygenBasic
  1. include "iup.inc"  
  2. sys win  
  3.  
  4. Sub Btn1_clicked() callback
  5.   IupMessage "OKAY","BUTTON 1 Event"  
  6. End Sub  
  7.  
  8. Sub Btn2_clicked() callback
  9.   IupMessage "OKAY","BUTTON 2 Event"  
  10. End Sub  
  11.  
  12. Sub Btn3_clicked() callback
  13.   IupMessage "OKAY","BUTTON 3 Event"  
  14. End Sub  
  15.  
  16. Sub Btn4_clicked() callback
  17.   IupMessage "OKAY","BUTTON 4 Event"  
  18. End Sub  
  19.  
  20. IupOpen 0,0  
  21. win=IupCreate("dialog")  
  22. IupSetAttributes win, "TITLE= Test Dialog, SIZE=300x"  
  23. horzbox = IupCreate("hbox")  
  24. IupSetAttributes(horzbox, "GAP=5")  
  25. btn1 = IupCreate("button")  
  26. IupSetAttributes(btn1, "TITLE=Button1, EXPAND=HORIZONTAL")  
  27. btn2 = IupCreate("button")  
  28. IupSetAttributes(btn2, "TITLE=Button2, EXPAND=HORIZONTAL")  
  29. btn3 = IupCreate("button")  
  30. IupSetAttributes(btn3, "TITLE=Button3, EXPAND=HORIZONTAL")  
  31.  
  32. btn4 = IupCreate("button")  
  33. IupSetAttributes(btn4, "TITLE=Button4, EXPAND=HORIZONTAL")  
  34.  
  35. IupAppend(horzbox, btn1)  
  36. IupAppend(horzbox, btn2)  
  37. IupAppend(horzbox, btn3)  
  38. IupAppend(horzbox, btn4)  
  39.  
  40. IupAppend(win, horzbox)  
  41. IupSetCallback(btn1, "ACTION", Btn1_clicked)  
  42. IupSetCallback(btn2, "ACTION", Btn2_clicked)  
  43. IupSetCallback(btn3, "ACTION", Btn3_clicked)  
  44. IupSetCallback(btn4, "ACTION", Btn4_clicked)  
  45.  
  46. IupShow win  
  47. IupMainLoop  
  48. IupClose  
  49.  
Title: Re: O2 / IUP
Post by: Charles Pegge on January 12, 2013, 11:37:28 AM
Hi John,

I think your callback setups should look like this:

passing the address of each sub rather than invoking them.

Code: OxygenBasic
  1. IupSetCallback(btn1, "ACTION", @Btn1_clicked)    
  2. IupSetCallback(btn2, "ACTION", @Btn2_clicked)    
  3. IupSetCallback(btn3, "ACTION", @Btn3_clicked)    
  4. IupSetCallback(btn4, "ACTION", @Btn4_clicked)    
  5.  

My testcode for this construct:

Code: [Select]
typedef int (*Icallback)(Ihandle*);

function setfunction(char*s,Icallback i) as sys
print "Set function addr " i
call i
end function

sub cb() callback
print "cb here"
end sub

setfunction("",@cb)


Charles
Title: Re: O2 / IUP
Post by: JRS on January 12, 2013, 11:47:52 AM
Thanks Charles. That solved the problem.

Almost had it back then if I would of known about the callback reference needed for the SUBs.

http://www.oxygenbasic.org/forum/index.php?topic=602.msg4634#msg4634

How can we get theme support (manifest) working with O2?



Title: Re: O2 / IUP
Post by: Charles Pegge on January 12, 2013, 12:11:21 PM
You will need to compile to an exe, then supply a manifest in the same folder:

myprog.exe.manifest

but I have never worked with manifests myself.

If your exe does not have an RTL included then you will need to have oxygen.dll in the same folder OR provide a pathmame in a file called oxygen.cfg

example:

..\..\oxygen.dll

Title: Re: O2 / IUP
Post by: JRS on January 12, 2013, 12:46:47 PM
I embedded the manifest in the Windows version of ScriptBasic but forgot how I did it. There are notes about  manifest embedding on the IUP site I'll have to dig up again.

Title: Re: O2 / IUP
Post by: Peter on January 12, 2013, 12:50:48 PM
Hi Charles,

Here are the correct button.
Code: [Select]
include "iup.inc"
sys win

Sub Btn1_clicked() callback
  static sys a
  a +=1
  PRINT "BUTTON 1 Event  " + a "x pressed"
End Sub

Sub Btn2_clicked() callback
  static sys a
  a +=1
  PRINT "BUTTON 2 Event  " + a "x pressed"
End Sub

Sub Btn3_clicked() callback
  static sys a
  a +=1
  PRINT "BUTTON 3 Event  " + a "x pressed"
End Sub

IupOpen(0,0)
win=IupCreate("dialog")
IupSetAttributes win, "TITLE= Test Dialog, 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", @Btn1_clicked)   
IupSetCallback(btn2,"ACTION", @Btn2_clicked)   
IupSetCallback(btn3,"ACTION", @Btn3_clicked)   
IupShow(win)
IupMainLoop()
IupClose()

X
Title: Re: O2 / IUP
Post by: JRS on January 12, 2013, 01:40:45 PM
Peter,

I get no event (PRINT) message boxes with your latest example and iup.inc file. How does the iupdef.inc get included into the program? Do you have any hints how to get theme support going in O2 beside the manifest file method?

Code: [Select]
! IupSetCallback      Lib "iup.dll" (sys ih, char *sname, sys func) as sys callback
' ! IupSetCallback      Lib "iup.dll" (iHandle *ih, char *sname, sys func) as sys callback

This revert of IupSetCallback() allowed your current example to run correctly.

John
Title: Re: O2 / IUP
Post by: Peter on January 12, 2013, 02:40:35 PM
Hi JRS,

All runs correctly, is by master peter.
It should look like this:

X
Title: Re: O2 / IUP
Post by: JRS on January 12, 2013, 04:16:31 PM
Quote
Windows XP/Vista/7 Visual Styles

Windows Visual Styles can be enabled using a manifest file. Uncomment the manifest file section in "iup.rc" file or copy it to your own resource file (you will need also to copy the manifest file "iup.manifest").

When using Visual C++ 8/9/10 with "iup.manifest", configure the linker properties of your project to do NOT generate a manifest file or the Windows Visual Styles from the RC file won't work.

If your Windows is using the Windows Classic theme or any other theme, IUP controls appearance will follow the system appearance only if you are using the manifest. If not using the manifest, then it will always look like Windows Classic.

Can someone show me how to use a .rc file with O2?

Here is a O2 forum link that already discusses this issue.

http://www.oxygenbasic.org/forum/index.php?topic=380.msg2755#msg2755

How can this be compiled into the application to allow theme support. I can't believe this hasn't come up before now. Win7 apps with a Win2000 look?

Can something like this be used?

Code: C
  1. // put it with other headers
  2.  
  3. #pragma comment( lib, "comctl32.lib")
  4.  
  5. #include <commctrl.h >
  6.  
  7. #pragma comment(linker, "/manifestdependency:\
  8.  
  9. "type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
  10. processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
  11.  
  12.  
  13. // put this call in WinMain() or elsewhere
  14.  
  15. InitCommonControls();
  16.  

The following O2 / IUP example is using a buttons.exe.manifest file for the style support. (just in case what I'm after isn't apparent)

(http://files.allbasic.info/O2/o2butstyle.png)

(http://files.allbasic.info/O2/o2butmsg.png)
Title: Re: O2 / IUP
Post by: Charles Pegge on January 13, 2013, 05:32:04 AM
Hi John,

Some resource tools here. James Fuller provided the LinkRes2Exe.

I will include them in tools/compiling

X
Title: Re: O2 / IUP
Post by: JRS on January 13, 2013, 05:46:55 AM
Thanks Charles. I will give this a try. I wonder if embedding the manifest in Oxygen.dll would work as a global solution?

Quote
LinkRes2Exe 1.02  (c)2006 by Mike Henning
Usage: LinkRes2Exe  file.res  file.exe [-verbose]

Code: [Select]
Z:\home\jrs\Downloads\OxygenBasic\restool>GoRC -?

GoRC.Exe Version 0.90.5 - Copyright Jeremy Gordon 1998/2009 - JG@JGnet.co.uk
Use this syntax in the command line:-

GoRC [command line switches] inputfile[.ext]

If the inputfile is RC, then by default, both RES and OBJ files are created
Override by using the /o or /r switch or by specifying an output file

Command line switches:-
/b=beep on error
/h=this help
/d=define a word (eg. /d WORD=0x345)
/e=empty output file allowed
/o=create OBJ file
/r=create RES file
/fo=specify output path/file eg. /fo myres.obj
            or /fo myres.obj, c:\res\myres.res
/machine AMD64 or /machine X64=object file to be in X64 (X86-64) format
            (default is X86 format for 32 bit Windows)
/ne /ni /nw=no error, information, warning messages respectively
/no=no output messages at all

Z:\home\jrs\Downloads\OxygenBasic\restool>
Title: Re: O2 / IUP
Post by: Peter on January 13, 2013, 06:26:18 AM
Hi together,

Cheating!
Title: Re: O2 / IUP
Post by: JRS on January 13, 2013, 06:52:12 AM
Thanks Peter for all the hard work building the O2/IUP include files and providing a set of IUP DLLs. I think you need to add a repaint callback to your demo.

Code: [Select]
IupShow win  
cvas=IupDrawCreateCanvas (win)
IupSetCallback cvas,"ACTION", Text

This is a cheating way to get the canvas to show Peter. (use a callback (after dialog show) to invoke the SUB rather than create a real repainting callback to handle resize and off screen issues)  :P

(http://files.allbasic.info/O2/iupdraw.png)

(http://files.allbasic.info/O2/iupdraw_blank.png)
Title: Re: O2 / IUP
Post by: JRS on January 13, 2013, 06:52:36 PM
Charles,

I thought I would go back and see if I could get the IUP C header (iup.h) method working with the buttons demo. I'm using your modified iup.h you posted but getting this error.

Code: OxygenBasic
  1. 'SUB BTN1_CLICKED
  2.  
  3. jmp fwd _over_
  4. o2 !10
  5. .btn1_clicked
  6. (
  7. push ebp
  8. mov ebp,esp
  9. add esp,-64
  10. lea edi,[ebp-12]
  11. xor eax,eax
  12. mov ecx,16
  13. (
  14. mov [edi],eax
  15. add edi,4
  16. sub ecx,4
  17. jg repeat
  18. )
  19. ERROR:
  20. direct void type not usable: ihandle:
  21. WORD:   sub
  22. LINE:   9
  23.  

(http://files.allbasic.info/O2/buterr_h.png)

Code: OxygenBasic
  1. includepath "C:\iup\include\"  
  2. extern lib "iup.dll" cdecl  
  3. include "iup.o2h"
  4. end extern    
  5.  
  6. sys win, horzbox, btn1, btn2, btn3
  7.  
  8. Sub Btn1_clicked() callback
  9.   static sys a
  10.   a +=1
  11.   PRINT "BUTTON 1 Event  " + a "x pressed"
  12. End Sub
  13.  
  14. Sub Btn2_clicked() callback
  15.   static sys a
  16.   a +=1
  17.   PRINT "BUTTON 2 Event  " + a "x pressed"
  18. End Sub
  19.  
  20. Sub Btn3_clicked() callback
  21.   static sys a
  22.   a +=1
  23.   PRINT "BUTTON 3 Event  " + a "x pressed"
  24. End Sub
  25.  
  26. IupOpen(0,0)
  27. win=IupCreate("dialog")
  28. IupSetAttributes win, "TITLE= Test Dialog, SIZE=300x"
  29. horzbox = IupCreate("hbox")
  30. IupSetAttributes(horzbox, "GAP=5")
  31. btn1 = IupCreate("button")
  32.  
  33. IupSetAttributes(btn1, "TITLE=Button1, EXPAND=HORIZONTAL")
  34. btn2 = IupCreate("button")
  35. IupSetAttributes(btn2, "TITLE=Button2, EXPAND=HORIZONTAL")
  36. btn3 = IupCreate("button")
  37. IupSetAttributes(btn3, "TITLE=Button3, EXPAND=HORIZONTAL")
  38.  
  39. IupAppend(horzbox, btn1)
  40. IupAppend(horzbox, btn2)
  41. IupAppend(horzbox, btn3)
  42. IupAppend(win, horzbox)
  43.  
  44. IupSetCallback(btn1,"ACTION", @Btn1_clicked)    
  45. IupSetCallback(btn2,"ACTION", @Btn2_clicked)  
  46. IupSetCallback(btn3,"ACTION", @Btn3_clicked)  
  47. IupShow(win)
  48. IupMainLoop()
  49. IupClose()
  50.  
Title: Re: O2 / IUP
Post by: JRS on January 13, 2013, 08:27:31 PM
I got it to work.

Code: OxygenBasic
  1. Sub Btn1_clicked()as sys callback
  2.  

I tried to add an argument to the callback fuction which compiles fine but exceptions at runtime.

Code: OxygenBasic
  1. FUNCTION Btn1_clicked(sys this_button)as sys callback
  2.  

I believe the callback FUNCTIONs should look like this and return IUP_DEFAULT.

Code: OxygenBasic
  1. includepath "C:\iup\include\"  
  2. extern lib "iup.dll" cdecl  
  3. include "iup.o2h"
  4. end extern    
  5.  
  6. sys win, horzbox, btn1, btn2, btn3
  7.  
  8. FUNCTION Btn1_clicked()as sys callback
  9.   static sys a
  10.   a +=1
  11.   PRINT "BUTTON 1 Event  " + a "x pressed"
  12.   RETURN IUP_DEFAULT
  13. END FUNCTION
  14.  
  15. FUNCTION Btn2_clicked()as sys callback
  16.   static sys a
  17.   a +=1
  18.   PRINT "BUTTON 2 Event  " + a "x pressed"
  19.   RETURN IUP_DEFAULT
  20. END FUNCTION
  21.  
  22. FUNCTION Btn3_clicked()as sys callback
  23.   static sys a
  24.   a +=1
  25.   PRINT "BUTTON 3 Event  " + a "x pressed"
  26.   RETURN IUP_DEFAULT
  27. END FUNCTION
  28.  
  29. IupOpen(0,0)
  30. win=IupCreate("dialog")
  31. IupSetAttributes win, "TITLE= Test Dialog, SIZE=300x"
  32. horzbox = IupCreate("hbox")
  33. IupSetAttributes(horzbox, "GAP=5")
  34. btn1 = IupCreate("button")
  35.  
  36. IupSetAttributes(btn1, "TITLE=Button1, EXPAND=HORIZONTAL")
  37. btn2 = IupCreate("button")
  38. IupSetAttributes(btn2, "TITLE=Button2, EXPAND=HORIZONTAL")
  39. btn3 = IupCreate("button")
  40. IupSetAttributes(btn3, "TITLE=Button3, EXPAND=HORIZONTAL")
  41.  
  42. IupAppend(horzbox, btn1)
  43. IupAppend(horzbox, btn2)
  44. IupAppend(horzbox, btn3)
  45. IupAppend(win, horzbox)
  46.  
  47. IupSetCallback(btn1,"ACTION", @Btn1_clicked)    
  48. IupSetCallback(btn2,"ACTION", @Btn2_clicked)  
  49. IupSetCallback(btn3,"ACTION", @Btn3_clicked)  
  50. IupShow(win)
  51. IupMainLoop()
  52. IupClose()
  53.  
Title: Re: O2 / IUP
Post by: Peter on January 14, 2013, 01:35:56 AM
Quote
This is a cheating way to get the canvas to show Peter.

LOL
if you do not likes it, then throw it away easily!  
Title: Re: O2 / IUP
Post by: Charles Pegge on January 14, 2013, 02:28:52 AM
Hi John,

Fixed a bug relating to void types. New Oxygen below.

This version of your code will now work with an undoctored iup.h.

Note that I have put all the callbacks into an extern cdecl block. cdecl allows the callbacks to receive parameters without gagging (ie corrupting the stack on return).

Charles

Code: OxygenBasic
  1. includepath "iup\"    
  2. extern lib "iup.dll" cdecl    
  3. include "iup.h"
  4. end extern      
  5.  
  6. sys win, horzbox, btn1, btn2, btn3  
  7.  
  8. extern cdecl
  9.  
  10.  
  11. FUNCTION Btn1_clicked(iHandle* h) as sys  
  12.   static sys a  
  13.   a +=1  
  14.   PRINT "BUTTON 1 Event  " + a "x pressed"  
  15.   RETURN IUP_DEFAULT  
  16. END FUNCTION
  17.  
  18. FUNCTION Btn2_clicked(iHandle* h) as sys  
  19.   static sys a  
  20.   a +=1  
  21.   PRINT "BUTTON 2 Event  " + a "x pressed"  
  22.   RETURN IUP_DEFAULT  
  23. END FUNCTION  
  24.  
  25. FUNCTION Btn3_clicked(iHandle* h) as sys
  26.   static sys a  
  27.   a +=1  
  28.   PRINT "BUTTON 3 Event  " + a "x pressed"  
  29.   RETURN IUP_DEFAULT  
  30. END FUNCTION
  31.  
  32. end extern
  33.  
  34.  
  35. IupOpen(0,0)  
  36. win=IupCreate("dialog")  
  37. IupSetAttributes win, "TITLE= Test Dialog, SIZE=300x"  
  38. horzbox = IupCreate("hbox")  
  39. IupSetAttributes(horzbox, "GAP=5")  
  40. btn1 = IupCreate("button")  
  41.  
  42. IupSetAttributes(btn1, "TITLE=Button1, EXPAND=HORIZONTAL")  
  43. btn2 = IupCreate("button")  
  44. IupSetAttributes(btn2, "TITLE=Button2, EXPAND=HORIZONTAL")  
  45. btn3 = IupCreate("button")  
  46. IupSetAttributes(btn3, "TITLE=Button3, EXPAND=HORIZONTAL")  
  47.  
  48. IupAppend(horzbox, btn1)  
  49. IupAppend(horzbox, btn2)  
  50. IupAppend(horzbox, btn3)  
  51. IupAppend(win, horzbox)  
  52.  
  53. IupSetCallback(btn1,"ACTION", @Btn1_clicked)      
  54. IupSetCallback(btn2,"ACTION", @Btn2_clicked)    
  55. IupSetCallback(btn3,"ACTION", @Btn3_clicked)    
  56. IupShow(win)  
  57. IupMainLoop()  
  58. IupClose()  
  59.  
Title: Re: O2 / IUP
Post by: Charles Pegge on January 14, 2013, 02:56:01 AM
This new version of Oxygen also supports dead code removal. It can take out all unused functions,subs and methods when the #compact directive is used. (Warning! If any Basic procedure is called exclusively from assembler, it will not be tagged as used, and will be thrown out!)

This allows programmers to work with large source code libraries, and still produce small binaries.

I have also extended the addr pseudo-instruction to resolve addresses of labels and string literals as well as variables.

.here
addr ecx,here

addr eax, "Hello World" '(must use eax for strings)

sys a,b,c
addr ecx,a

Charles
Title: Re: O2 / IUP
Post by: JRS on January 14, 2013, 06:13:20 AM
Quote
if you do not likes it, then throw it away easily!

Your demo is a great introduction to using IUP canvas draw. It just has some repaint issues that I'm sure you can fix with a line or two of code.

Please don't take my desire to use C headers via your includes in a negative way. As you say, your a busy guy and I can't depend on anyone to maintain a set of custom IUP includes. I have seen FreeBASIC struggle with their external library .bi include files for years. I think we need to support Charles with his efforts to play nice with tools that everyone else uses.

Title: Re: O2 / IUP
Post by: Aurel on January 14, 2013, 06:38:47 AM
Quote
This allows programmers to work with large source code libraries, and still produce small binaries.
This sounds fine.. :)
Title: Re: O2 / IUP
Post by: JRS on January 14, 2013, 08:31:47 AM
Charles,

The new Oxygen.dll no longer likes C #define.  :'(

(http://files.allbasic.info/O2/dflterr.png)

Code: OxygenBasic
  1. includepath "C:\iup\include\"    
  2. extern lib "iup.dll" cdecl    
  3. include "iup.h"
  4. end extern      
  5.  

Update

I had to go back to the slightly modified iup.h (iup.o2h) for it to work.

Code: C
  1. '===================================
  2. 'ADAPTATION FOR OXYGENBASIC Dec 2012
  3. '===================================
  4. 'typedef struct Ihandle_ Ihandle;
  5. 'typedef int (*Icallback)(Ihandle*);
  6. typedef void IHandle
  7. typedef sys  ICallback
  8. '===================================
  9.  
Title: Re: O2 / IUP
Post by: Charles Pegge on January 14, 2013, 10:38:31 AM
Hi John,

I tested with the original IUP header. Are you sure the new DLL is in the Oxygen root folder?

I have posted a new Oxygen-in-progress including your demo as projectsb/IUP/jsdemo2H.o2bas

Charles
Title: Re: O2 / IUP
Post by: JRS on January 14, 2013, 11:39:27 AM
Your latest Oxygen-in-progress works fine. I'm not sure where the issue was. (too much on-the-fly updating perhaps)
Title: Re: O2 / IUP
Post by: Charles Pegge on January 14, 2013, 11:55:15 AM
Phew! I think it's called DLL hell. The gxo2 compiler looks for Oxygen.dll in the same folder as itself. If you compile to an oxygen-dependent binary then Oxygen needs to be included in the same folder as the binary.

Charles
Title: Re: O2 / IUP
Post by: Peter on January 14, 2013, 12:13:38 PM
And once again for JRS.
Code: [Select]
include "iup.inc"

iupOpen 0,0
select iupAlarm("iupAlarm test", "File not saved! Save it now?", "Yes", "No", "Cancel")
       case 1
          IupMessage ("Save file", "File saved successfully - leaving program")
       case 2
          IupMessage ("Save file", "File not saved - leaving program anyway")
       case 3
          IupMessage ("Save file", "Operation canceled")
end select     
iupClose
Title: Re: O2 / IUP
Post by: JRS on January 14, 2013, 07:23:56 PM
Thanks Peter!

(http://files.allbasic.info/O2/alert2h.png)

(http://files.allbasic.info/O2/alertmb2h.png)

Code: OxygenBasic
  1. includepath "iup\"    
  2. extern lib "iup.dll" cdecl    
  3. include "iup.h"
  4. end extern      
  5.  
  6.  
  7. iupOpen 0,0
  8. select iupAlarm("iupAlarm test", "File not saved! Save it now?", "Yes", "No", "Cancel")
  9.        case 1
  10.           IupMessage ("Save file", "File saved successfully - leaving program")
  11.        case 2
  12.           IupMessage ("Save file", "File not saved - leaving program anyway")
  13.        case 3
  14.           IupMessage ("Save file", "Operation canceled")
  15. end select      
  16. iupClose
  17.  
Title: Re: O2 / IUP
Post by: Peter on January 15, 2013, 02:50:05 AM
Hi,

The image shows some OXYGEN-IUP programmers, after their programming of a button bar.



X
Title: Re: O2 / IUP
Post by: JRS on January 15, 2013, 07:16:12 AM
Peter,

Should I assume that you think IUP is a dead-end for OxygenBasic programmers or did I miss something in the translation?

John
Title: Re: O2 / IUP
Post by: Charles Pegge on January 15, 2013, 04:14:44 PM
Another Oxygen update coming soon! COM (speech API) did not like the last one.
Title: Re: O2 / IUP
Post by: JRS on January 15, 2013, 05:50:34 PM
Are you speaking of COM in general or the IupOleControl (http://www.tecgraf.puc-rio.br/iup/en/ctrl/iupole.html) control?

I know the IUP thread has taken center stage recently and I just want to make sure this announcement meant you were digging into the more advanced features of the IUP API.  ;D

 
Title: Re: O2 / IUP
Post by: Charles Pegge on January 15, 2013, 07:34:06 PM
It misreads my SAPI headers - it should not affect IUP
Title: Re: O2 / IUP
Post by: JRS on January 15, 2013, 08:29:21 PM
Can you show me how I would use multiple DLLs and .h files with a program?

IE:

iup.dll
iupcontrols.dll
cd.dll
iupcd.dll

And the .h files that go with them. Look at the All Basic site BaCon OpenGL example.

Title: Re: O2 / IUP
Post by: Charles Pegge on January 16, 2013, 01:34:22 AM
Hi John,

like this:

extern cdecl lib "lib1.dll"
include "lib1.h"
extern cdecl lib "lib2.dll"
include "lib2.h"
extern cdecl lib "lib3.dll"
include "lib3.h"
end extern

This syntax is also supported:

extern cdecl
library "lib1.dll"
include "lib1.h"
library "lib2.dll"
include "lib2.h"
library "lib3.dll"
include "lib3.h"
end extern
Title: Re: O2 / IUP
Post by: JRS on January 16, 2013, 06:50:45 AM
Quote
This syntax is also supported:

Code: OxygenBasic
  1. extern cdecl
  2. library "lib1.dll"
  3. include "lib1.h"
  4. library "lib2.dll"
  5. include "lib2.h"
  6. library "lib3.dll"
  7. include "lib3.h"
  8. end extern
  9.  

Thanks!

It doesn't get any easier than that.

@Peter - I think I figured out your shelf of skulls post. I took a peek at the buttonbar.c example you referred to and the menu definition example. Is that what reminded you of the shelf of skulls?

Title: Re: O2 / IUP
Post by: Charles Pegge on January 16, 2013, 09:34:46 AM
Some further fixes:

This Oxygen is much more efficient at handling huge library headers. - What to do when faced with thousands of API declarations. Lazy parsing is one solution. But I have not dared to try the José API headers yet;  currently around 74 megabytes :o

X