FLTK-C-1.3.3 for FreeBASIC

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
Post Reply
CFreBasic
Posts: 14
Joined: Feb 01, 2015 21:17

Re: FLTK C for FreeBASIC.

Post by CFreBasic »

Tested...and...IT WORKS! :-)
And yes, the "key" was STATIC.

And thanks, D.j.peters for the difference with Set and Copy

As request D.j.peters, could you post with the .Dll in the first post the "static" libraries for 32 and 64.dll?
(the "...dll.a " )
I have a lot of problems, with the errors making them.
jdebord
Posts: 547
Joined: May 27, 2005 6:20
Location: Limoges, France
Contact:

Re: FLTK C for FreeBASIC.

Post by jdebord »

You can create the import library with pexports and dlltool :

Code: Select all

pexports XXX.dll > XXX.def
dlltool -D XXX.dll -d XXX.def -l libXXX.dll.a
Of course, replace XXX with the name of the FLTK library which you are using.

pexports.exe and dlltool.exe should be in your FreeBASIC bin\win... subdirectory

In case you don't have pexports in your FB installation, you can get here:

https://sourceforge.net/projects/mingw/ ... /pexports/

Alternatively, you can use tiny_impdef from the TCC (Tiny C compiler) distribution:
http://bellard.org/tcc/

Both pexports and tiny_impdef produce a text file with extension .def which contains the list of all the routines exported by the DLL.

Note: if using pexports, it may be necessary to edit the .def file by removing the first line, before using dlltool
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FLTK C for FreeBASIC.

Post by D.J.Peters »

can't edit first post ATM.

Joshy
Last edited by D.J.Peters on Aug 13, 2016 21:44, edited 2 times in total.
CFreBasic
Posts: 14
Joined: Feb 01, 2015 21:17

Re: FLTK C for FreeBASIC.

Post by CFreBasic »

*jdebord: i have both .exe, the problem was with dlltool, that returns errors like: "syntax error in def file".... and so.
I will try removing the first line as you say.

*Joshy: and thanks, for the quick answer.
greenink
Posts: 200
Joined: Jan 28, 2016 15:45

Re: FLTK C for FreeBASIC.

Post by greenink »

I guess it would work well with C capable scripting languages like LuaJIT and Terra. I was also considering tcl/tk. So far I've been trying to communicate via pipes (sdtin and stdout) with "wish". That is super simple but also there are problems because there are no bidirectional pipes as such and there are potential deadlocking issues (eg. like you locked your keys in the car). I'll experiment around for a while and see what is the most stable, repeatable solution. Then look at making a simple Basic out of that.
http://terralang.org/
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FLTK C for FreeBASIC.

Post by D.J.Peters »

Fixed a small bug (Windows 32/64-bit) the fltk-c wrapper is -w pedantic compatible now.
(Windows 32/64-bit, Linux 32/64-bit and ARM 32-bit all in one zip archive)

Joshy
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK C for FreeBASIC.

Post by Boris the Old »

Joshy

I've just downloaded the latest Linux fltk-c-1.3.3.zip, but I'm not seeing any lib*.so files. Am I missing something on account of my extreme old age?

Thanks

Rod
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FLTK C for FreeBASIC.

Post by D.J.Peters »

@Rod yes the libs was missing should be fixed now.

Joshy
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK C for FreeBASIC.

Post by Boris the Old »

Thanks Joshy

Rod
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK C for FreeBASIC.

Post by Boris the Old »

Joshy

There's a potentially recursive wrapper bug in fltk-c.bi -- the link points to the obsolete forum topic. :-)

Please report all FLTK C wrapper bugs and problems on the following page:
http://freebasic.net/forum/viewtopic.php?f=14&t=21548

Rod
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK C for FreeBASIC.

Post by Boris the Old »

Joshy

I really like the new commands. It's so much easier than playing with hidden fltk structures. However, I think there's an error in the following declares:

Code: Select all

' Set/Get a user-data value for the item.
declare sub      Fl_Tree_ItemSetUserData(byval item as Fl_Tree_Item ptr, byval userdata as any ptr)
declare function Fl_Tree_ItemGetUserData() as any ptr
The Get function seems to be missing an item parm

Thanks

Rod
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FLTK C for FreeBASIC.

Post by D.J.Peters »

Hello rod you are right it must be:

Code: Select all

declare function Fl_Tree_ItemGetUserData(byval item as Fl_Tree_Item ptr) as any ptr
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK C for FreeBASIC.

Post by Boris the Old »

Thanks Joshy
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: FLTK C for FreeBASIC.

Post by ike »

This is very nice! You can rotate icons on buttons


Look at your numeric keyboard for meanings like 8 mean UP 4 mean left

Code: Select all

MOVROT.btn1 = Fl_ButtonNew(50, 130, 40, 40, "@1>>") 
MOVROT.btn2 = Fl_ButtonNew(100, 130, 40, 40, "@2>>") 
MOVROT.btn3 = Fl_ButtonNew(150, 130, 40, 40, "@3>>") 
MOVROT.btn4 = Fl_ButtonNew(50, 80, 40, 40, "@4>>") 

MOVROT.btn6 = Fl_ButtonNew(150, 80, 40, 40, "@6>>") 
MOVROT.btn7 = Fl_ButtonNew(50, 30, 40, 40, "@7>>") 
MOVROT.btn8 = Fl_ButtonNew(100, 30, 40, 40, "@8>>") 
MOVROT.btn9 = Fl_ButtonNew(150, 30, 40, 40, "@9>>") 

It took me couple hrs to design some icons and then I figured out this trick

@ may be followed by
# to keep aspect ratio
+9 to make icons bigger can be any number 1 to 9. 9 is biggest

LIKE:

MOVROT.btn7 = Fl_ButtonNew(50, 30, 40, 40, "@#+97>>")

http://www.csounds.com/manual/html/FLbutton.html
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK C for FreeBASIC.

Post by Boris the Old »

@ike
ike wrote:This is very nice! You can rotate icons on buttons........It took me couple hrs to design some icons and then I figured out this trick

MOVROT.btn7 = Fl_ButtonNew(50, 30, 40, 40, "@#+97>>")

http://www.csounds.com/manual/html/FLbutton.html
I don't program in Python, but I've found the following documentation to be really useful. It's a lot easier to understand than the FLTK docs, and it helps make sense of Joshy's bindings. It's relatively easy to create FB classes that follow the general structure of the Python classes.

http://pyfltk.sourceforge.net/docs/CH0_Preface.html

Rod
Post Reply