Author Topic: need O2 IUP translation  (Read 6564 times)

0 Members and 1 Guest are viewing this topic.

jcfuller

  • Jr. Member
  • **
  • Posts: 69
Re: need O2 IUP translation
« Reply #15 on: August 09, 2012, 06:35:06 AM »
This is a FreeBASIC demo that works using
http://sourceforge.net/projects/iup/files/3.5/Windows%20Libraries/iup-3.5_Win32_dll6_lib.zip/download

James


Code: [Select]
extern lib "\iup_dll6\iup.dll"
    sys IupOpen (sys argc ,sys argv)
    sys IupCreate (char* cname)
    void IupClose()
    sys IupSetAttributes(sys ih ,char* strz)
    sys IupAppend (sys ih ,sys child)
    void IupRefresh(sys ih)
    sys IupSetCallback (sys ih ,char* sname ,sys func)
    sys IupShow (sys ih)
    sys IupSetFocus (sys ih)
    void IupMainLoop()
    void IupMessage(char* title, char *msg)
end extern

'' Initializes IUP
    IupOpen(0,0)

'' Executes IupMessage
  IupMessage("IupMessage Example", "Press the button")

  '' Initializes IUP main loop
  IupMainLoop ()

  '' Finishes IUP
  IupClose ()


Charles Pegge

  • Author
  • *****
  • Posts: 3334
    • Oxygen Basic
Re: need O2 IUP translation
« Reply #16 on: August 09, 2012, 07:20:33 AM »
Is the  new Oxygen in the same directory as your compilers: gxo2 / exo2 ?

jcfuller

  • Jr. Member
  • **
  • Posts: 69
Re: need O2 IUP translation
« Reply #17 on: August 09, 2012, 08:23:49 AM »

Yes

James

Peter

  • Full Member
  • ***
  • Posts: 146
Re: need O2 IUP translation
« Reply #18 on: August 09, 2012, 08:29:07 AM »
Hi,

try this.

X

Aurel

  • Guest
Re: need O2 IUP translation
« Reply #19 on: August 09, 2012, 08:35:51 AM »
I am not sure what is wrong but looks to me that oxygen don't recognize
.lib file.
I made quick test
create dll in Ebasic
create import library .lib file
create .inc file who call .lib file
but how include .lib file - not in scope ???

Aurel

  • Guest
Re: need O2 IUP translation
« Reply #20 on: August 09, 2012, 08:40:38 AM »
What a fu**   ;D
Eh - Peter you are really MEISTER... ;)
Thank you...
So there is a catch which i never will figured... ::)
Code: [Select]
extern lib "iup.dll" cdecl
sys iup
iup = LoadLibrary "iup.dll"
....
....
end extern
« Last Edit: August 09, 2012, 09:36:27 AM by Aurel »

Charles Pegge

  • Author
  • *****
  • Posts: 3334
    • Oxygen Basic
Re: need O2 IUP translation
« Reply #21 on: August 09, 2012, 09:04:33 AM »
Thanks Peter

Your IUP dll works with my demo translation (above) too!

I see your version is 3.1.0.0, whereas the duff version I was struggling with is also labelled 3.1.0.0.

Where did you get it from?

James,

Your system is trying to use an old oxygen.dll, rather than the new one. I think it's the new '!' syntax for declarations causing the error.

Aurel,

Libs are not supported - I understand they are compiler-specific: FB uses the GNU linker.

Charles
« Last Edit: August 09, 2012, 09:29:48 AM by Charles Pegge »

efgee

  • Full Member
  • ***
  • Posts: 172
Re: need O2 IUP translation
« Reply #22 on: August 09, 2012, 09:14:04 AM »
IUP is a nice little GUI library.
Doesn't have as many controls as other GUI libraries like wxWidget or QT but is much easier to use  8)

The only downside (for me) is that there is no OSX version  :'(

Peter

  • Full Member
  • ***
  • Posts: 146
Re: need O2 IUP translation
« Reply #23 on: August 09, 2012, 09:33:52 AM »
Quote
Where did you get it from?

sorry Charles, I did forget the link.
But some interesting  DEFs for IUP can you find here.


X

Aurel

  • Guest
Re: need O2 IUP translation
« Reply #24 on: August 09, 2012, 09:40:51 AM »
Quote
Aurel,
Libs are not supported - I understand they are compiler-specific: FB uses the GNU linker.
Aha ,i see and i think that would work without .lib file ,only dll.is important for LoadLibrary().
But i am not 100% sure ,ok i will try... ;)

John

  • Hero Member
  • *****
  • Posts: 2829
Re: need O2 IUP translation
« Reply #25 on: August 09, 2012, 09:59:00 AM »
Quote
The only downside (for me) is that there is no OSX version.

On a positive note, we have 4 or so Basic languages (interpreter, translator and compilers) all executing the same IUP GUI code. That in itself makes this worth doing.


Peter

  • Full Member
  • ***
  • Posts: 146
Re: need O2 IUP translation
« Reply #26 on: August 09, 2012, 10:44:22 AM »
Hi,

Here is my  iup teacher. Grandmother Wirbelauer, Physics/Mathematics Professor.

X

Aurel

  • Guest
Re: need O2 IUP translation
« Reply #27 on: August 09, 2012, 11:36:07 AM »
Uff ..i always mean that your teacher is Opa  ;D
zwei + zwei ist drei.... 8)

jcfuller

  • Jr. Member
  • **
  • Posts: 69
Re: need O2 IUP translation
« Reply #28 on: August 09, 2012, 12:00:03 PM »
Charles,
  There is no other oxygen.dll on my machine.
To be sure I did a complete search.
I then deleted my OxygenBasic directory and downloaded the in progress version

I copied your code from above.
I fired up SciTE.
I pasted and saved the code.

I then did a tools->compile and get this in the right pane:

Code: [Select]
>"C:\OxygenBasic\gxo2" " -c t01.o2bas"

ERROR:
parameters mismatch for procedure string:
params given : #long@0

OPTIONS:
string(sys,sys) returns string
string(sys,zstring) returns string
string(sys,string) returns string


WORD: cname
LINE: 10


>Exit code: 0


I then deleted the oxygen.dll and tried again.
I then got a can't find oxygen.dll popup.

I added the oxygen.dll from your link above and the results were the same as the first attempt.


James

Aurel

  • Guest
Re: need O2 IUP translation
« Reply #29 on: August 09, 2012, 12:14:26 PM »
James
do you try
strptr cname