FLTK C for FreeBASIC Jan 09, 2017

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
D.J.Peters
Posts: 7659
Joined: May 28, 2005 3:28

Re: FLTK C for FreeBASIC Jan 09, 2017

Postby D.J.Peters » Jan 06, 2019 17:48

@oyster FLTK and fltk-c is all GPL but you don't have to remove the copyrights :-)

The Nim language can interface to C++ so why do you will use a FreeBASIC C binding and not FLTK C++ directly ?

How ever the simplest game ever the snake game compiled with Nim to JavaScript are 353,280 bytes (345 KB)

run the game:
https://picheta.me/snake/

view or save the created *.js file:
https://picheta.me/snake/snake.js

Joshy
oyster
Posts: 178
Joined: Oct 11, 2005 10:46

Re: FLTK C for FreeBASIC Jan 09, 2017

Postby oyster » Jan 07, 2019 5:20

you scared me. So I checked https://www.fltk.org/COPYING.php and find FLTK uses LGPL, I understand that it is ok to use FLTK dynamic file(i.e. DLL on windows) even in commercial, close-source app. In fact, FLTK uses a modified LGPL, so if I use only official FLTK without modification, I can do static linking even in commercial, close-source app.

As for your fltk*.bi, if you choose GPL, it could be a disaster for me because any app uses GPLed library must open the source to the client.
oyster
Posts: 178
Joined: Oct 11, 2005 10:46

Re: FLTK C for FreeBASIC Jan 09, 2017

Postby oyster » Jan 07, 2019 5:30

3 more things
1. how to do static link with FLTK in fb app?

2. does the spreadsheet/table in fltk*.bi support sorting by clicking the column header?

3. As for fltk for nim, https://github.com/Skrylar/nfltk is updated in July 2018, and there is only one test but you supplied so many!
oyster
Posts: 178
Joined: Oct 11, 2005 10:46

Re: FLTK C for FreeBASIC Jan 09, 2017

Postby oyster » Jan 11, 2019 1:43

@D.J.Peters
I am still waiting for your declaration on the license of your fltk*.bi

If I use a lib who has GPL license, then GPL requires me to open all of my code

If I use a lib who has LGPL license, then I can closesource my code when I use the lib as DLL; but if I try to do static link, I have to open all my source. However since your fltk*.bi are all code, I think LGPL can't apply to it

English is not my native language, so correct me if there is something wrong
D.J.Peters
Posts: 7659
Joined: May 28, 2005 3:28

Re: FLTK C for FreeBASIC Jan 09, 2017

Postby D.J.Peters » Jan 11, 2019 11:32

You can wait if you like but it is what it is :-)

http://www.fltk.org/COPYING.php

COPYING wrote:4. You do not have to provide a copy of the FLTK license with programs that are linked to the FLTK library, nor do you have to identify the FLTK license in your program or documentation as required by section 6 of the LGPL.

However, programs must still identify their use of FLTK. The following example statement can be included in user documentation to satisfy this requirement:

[program/widget] is based in part on the work of the FLTK project (http://www.fltk.org).


Joshy

Code: Select all

'  FreeBASIC header file for the Fast Light Tool Kit C wrapper.
'  FLTK C wrapper copyright 2013-2019 by D.J.Peters

'  C++ library Fast Light Tool Kit (FLTK)
'  Copyright 1998-2010 by Bill Spitzak and others.
'
'  This library is free software. Distribution and use rights are outlined in
'  the file "COPYING" which should have been included with this file.  If this
'  file is missing or damaged, see the license at:
'
'    http://www.fltk.org/COPYING.php
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: FLTK C for FreeBASIC Jan 09, 2017

Postby lizard » Jan 11, 2019 20:08

This seems the best GUI for FB at the moment. All works out of the box here on Linux Mint 18.3 64bit.
oyster
Posts: 178
Joined: Oct 11, 2005 10:46

Re: FLTK C for FreeBASIC Jan 09, 2017

Postby oyster » Jan 14, 2019 13:00

should

Code: Select all

declare function Fl_ScreenY      alias "Fl_GetX" as long

be

Code: Select all

declare function Fl_ScreenY      alias "Fl_GetY" as long

in fltk-main.bi ?
oyster
Posts: 178
Joined: Oct 11, 2005 10:46

Re: FLTK C for FreeBASIC Jan 09, 2017

Postby oyster » Jan 16, 2019 1:12

Regards from nimlang

Code: Select all

import fltk_main

proc ButtonClick (button: ptr FL_WIDGET, arg: pointer):cint {.cdecl.} =
  Fl_WidgetCopyLabel(button, "do it again")

var Win = Fl_WindowNew(320, 200, "What a shiny Window :-)")
var Btn = Fl_ButtonNew(10, 10, 120, 32, "click me")
Fl_WidgetSetCallback(Btn, ButtonClick)
Fl_WindowShow(Win)
Fl_Run()
oyster
Posts: 178
Joined: Oct 11, 2005 10:46

Re: FLTK C for FreeBASIC Jan 09, 2017

Postby oyster » Jan 25, 2019 6:08

in Fl_Overlay_WindowEx.bas

Code: Select all

Fl_WidgetSetCallbackArg Fl_ButtonNew( 50, 50,100,100,"wider")   ,@Button1CB,win
Fl_WidgetSetCallbackArg Fl_ButtonNew(250, 50,100,100,"narrower"),@Button2CB,win
Fl_WidgetSetCallbackArg Fl_ButtonNew( 50,250,100,100,"taller")  ,@Button3CB,win
Fl_WidgetSetCallbackArg Fl_ButtonNew(250,250,100,100,"shorter") ,@Button4CB,win


should be

Code: Select all

Fl_WidgetSetCallbackArg Fl_ButtonNew( 50, 50,100,100,"wider")   ,@Button3CB,win
Fl_WidgetSetCallbackArg Fl_ButtonNew(250, 50,100,100,"narrower"),@Button4CB,win
Fl_WidgetSetCallbackArg Fl_ButtonNew( 50,250,100,100,"taller")  ,@Button1CB,win
Fl_WidgetSetCallbackArg Fl_ButtonNew(250,250,100,100,"shorter") ,@Button2CB,win

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 1 guest