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
angros47
Posts: 2331
Joined: Jun 21, 2005 19:04

Re: FLTK-C-1.3.3 for FreeBASIC

Post by angros47 »

Just my curiosity.... but in case of FLTK, what prevents from using it directly from FreeBasic, without a C wrapper? I had a look at the include files, they seem normal class (and I know FreeBasic is compatible with C++ at least at ABI level)
robert
Posts: 169
Joined: Aug 06, 2019 18:45

Re: FLTK-C-1.3.3 for FreeBASIC

Post by robert »

Typo fixed.
Last edited by robert on Apr 16, 2020 8:05, edited 1 time in total.
systemctl
Posts: 182
Joined: Mar 27, 2020 5:15

Re: FLTK-C-1.3.3 for FreeBASIC

Post by systemctl »

The current version of FLTK is 1.3.5. Could you update your binding to this version?
Kwabbernoot
Posts: 80
Joined: Apr 19, 2010 18:23
Location: NL

Re: FLTK-C-1.3.3 for FreeBASIC

Post by Kwabbernoot »

The following functions exist:
Fl_WindowNew
Fl_WindowExNew
Fl_BoxNew
Fl_BoxExNew
Fl_ButtonNew
Fl_ButtonExNew

What is the difference between the functions with "Ex" and without "Ex"?
Kwabbernoot
Posts: 80
Joined: Apr 19, 2010 18:23
Location: NL

Re: FLTK-C-1.3.3 for FreeBASIC

Post by Kwabbernoot »

I've written a FLTK program for printing.
Some remarks.
1) After a Fl_PrinterSetCurrent you can't write anything to the screen anymore. For instance: Fl-WidgetCopyLabel won't work. After executing Fl_PrinterEndJob you can write to the screen again.

2) You can't write empty lines to the printer, you must have a line with at least one space.

3) There is a Fl_PrinterGetMargins, but there is no Fl_PrinterSetMargins.
What I wanted, was a small left margin. So I tried a negative column number (the x argument of DrawString). To my surprise, it works ! So you can work with a small left margin by specifying a negative x-value in DrawString.
jevans4949
Posts: 1186
Joined: May 08, 2006 21:58
Location: Crewe, England

Re: FLTK-C-1.3.3 for FreeBASIC

Post by jevans4949 »

Can somebody advise me?

I have written a process for a long file (the UK postcode CSV file) within a FLTK program. To reassure that it's still running I am trying to put in a progress "meter", to show the value of the file record I'm processing. I've tried using an fl_output field, but the display doesn't update until the process completes. Is there some widget type I can use which will update the display without control being returned to the screen handler?
D.J.Peters
Posts: 8588
Joined: May 28, 2005 3:28
Contact:

Re: FLTK-C-1.3.3 for FreeBASIC

Post by D.J.Peters »

@jevans4949
There are Fl_Progress01.bas shows you how to use a timeout handler as parallel task !
There are Timesharing01.bas shows you how to do an heavy task in background !
There are Fl_Wait02.bas shows you how do you control the event loop manually !

post a short example with equal problem I will try to help

Joshy
jevans4949
Posts: 1186
Joined: May 08, 2006 21:58
Location: Crewe, England

Re: FLTK-C-1.3.3 for FreeBASIC

Post by jevans4949 »

Thanks, I will look ai these.
D.J.Peters
Posts: 8588
Joined: May 28, 2005 3:28
Contact:

Re: FLTK-C-1.3.3 for FreeBASIC

Post by D.J.Peters »

@Kwabbernoot

you can print a complete window with Fl_PrinterPrintWindow()

Code: Select all

var prt = Fl_PrinterNew()
Fl_PrinterStartJob(prt,1)
Fl_PrinterStartPage(prt)
Fl_PrinterPrintWindow prt,win
Fl_PrinterEndPage prt
Fl_PrinterDelete prt
or print a widget with Fl_PrinterPrintWidget()

Code: Select all

var prt = Fl_PrinterNew()
Fl_PrinterStartJob(prt,1)
Fl_PrinterStartPage(prt)
Fl_PrinterPrintWidget prt,wgt
Fl_PrinterEndPage prt
Fl_PrinterDelete prt
or you can draw on the printer with Fl_PrinterSetCurrent()

Code: Select all

var prt = Fl_PrinterNew()
Fl_PrinterStartJob(prt,1)
Fl_PrinterStartPage(prt)
Fl_PrinterSetCurrent prt
DrawLine Circle, Text etc.
....
Fl_PrinterEndPage prt
Fl_PrinterEndJob prt
Fl_PrinterDelete prt
Remember there are Fl_PrinterSetCurrent() and Fl_WindowMakeCurrent()

If you make the printer the current target of commands with Fl_PrinterSetCurrent()
after printing you can/must make a window as new current target (if needed) with Fl_WindowMakeCurrent() !

Joshy
jevans4949
Posts: 1186
Joined: May 08, 2006 21:58
Location: Crewe, England

Re: FLTK-C-1.3.3 for FreeBASIC

Post by jevans4949 »

I solved my problem of displaying progess in file processing simply by adding an fl_wait() after updating my main display, with the "outward" part of the postcode when it changed. Valuable to get an indication of progress when you're processing 30 million records. Next test, check I can get Shetland (postcode ZE).
D.J.Peters
Posts: 8588
Joined: May 28, 2005 3:28
Contact:

Re: FLTK-C-1.3.3 for FreeBASIC

Post by D.J.Peters »

jevans4949 wrote:I solved my problem of displaying progess in file processing simply by adding an fl_wait() after updating my main display
So you create the GUI and enters the message loop with Fl_Run() and inside your processing stuff you call Fl_Wait() right ?

Joshy
jevans4949
Posts: 1186
Joined: May 08, 2006 21:58
Location: Crewe, England

Re: FLTK-C-1.3.3 for FreeBASIC

Post by jevans4949 »

D.J.Peters wrote:
jevans4949 wrote:I solved my problem of displaying progess in file processing simply by adding an fl_wait() after updating my main display
So you create the GUI and enters the message loop with Fl_Run() and inside your processing stuff you call Fl_Wait() right ?

Joshy
Yes. The FLTK bit is used to select the input and output files and the parameters for the record selection. The file processing is fairly boring, and on change of postcode I update the display with corrent record key, then do a wait. I will probably enhance this to show numberof records read / written.

The aim is to select records for your town to make a file small enough to process with a spreadsheet program.

Unlke zip codes, UK postcodes are alphanumeric. A full list of all codes is available in CSV format free to charities and business startups once a quarter. See poweredbypaf.com for information.
fly
Posts: 5
Joined: Nov 08, 2021 6:51

Re: FLTK-C-1.3.3 for FreeBASIC

Post by fly »

Can you share the stastic library of FLTK rather than import library?
fly
Posts: 5
Joined: Nov 08, 2021 6:51

Re: FLTK-C-1.3.3 for FreeBASIC

Post by fly »

" fltk-c-1.3.3-src.zip" can not be complied successfully.



||=== Build: win32 in fltk-c-wrapper-1.3.3-dynamic (compiler: GNU GCC Compiler) ===|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-tooltip.cpp||In function 'void Fl_TooltipSetMarginWidth(int)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-tooltip.cpp|68|error: no matching function for call to 'Fl_Tooltip::margin_width(int&)'|
c:\mingw\include\fl\fl_tooltip.h|95|note: candidate: 'static int Fl_Tooltip::margin_width()'|
c:\mingw\include\fl\fl_tooltip.h|95|note: candidate expects 0 arguments, 1 provided|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-tooltip.cpp||In function 'void Fl_TooltipSetMarginHeight(int)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-tooltip.cpp|75|error: no matching function for call to 'Fl_Tooltip::margin_height(int&)'|
c:\mingw\include\fl\fl_tooltip.h|96|note: candidate: 'static int Fl_Tooltip::margin_height()'|
c:\mingw\include\fl\fl_tooltip.h|96|note: candidate expects 0 arguments, 1 provided|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-tooltip.cpp||In function 'void Fl_TooltipSetWrapWidth(int)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-tooltip.cpp|82|error: no matching function for call to 'Fl_Tooltip::wrap_width(int&)'|
c:\mingw\include\fl\fl_tooltip.h|97|note: candidate: 'static int Fl_Tooltip::wrap_width()'|
c:\mingw\include\fl\fl_tooltip.h|97|note: candidate expects 0 arguments, 1 provided|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'Fl_Tree_Item* Fl_Tree_ItemNew(Fl_Tree*)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|8|error: no matching function for call to 'Fl_Tree_Item::Fl_Tree_Item(Fl_Tree*&)'|
c:\mingw\include\fl\fl_tree_item.h|132|note: candidate: 'Fl_Tree_Item::Fl_Tree_Item(const Fl_Tree_Item*)'|
c:\mingw\include\fl\fl_tree_item.h|132|note: no known conversion for argument 1 from 'Fl_Tree*' to 'const Fl_Tree_Item*'|
c:\mingw\include\fl\fl_tree_item.h|125|note: candidate: 'Fl_Tree_Item::Fl_Tree_Item(const Fl_Tree_Prefs&)'|
c:\mingw\include\fl\fl_tree_item.h|125|note: no known conversion for argument 1 from 'Fl_Tree*' to 'const Fl_Tree_Prefs&'|
c:\mingw\include\fl\fl_tree_item.h|67|note: candidate: 'constexpr Fl_Tree_Item::Fl_Tree_Item(const Fl_Tree_Item&)'|
c:\mingw\include\fl\fl_tree_item.h|67|note: no known conversion for argument 1 from 'Fl_Tree*' to 'const Fl_Tree_Item&'|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'int Fl_Tree_ItemDrawItemContent(Fl_Tree_Item*, int)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|43|error: 'class Fl_Tree_Item' has no member named 'draw_item_content'|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'void Fl_Tree_ItemDraw(Fl_Tree_Item*, int, int&, int, Fl_Tree_Item*, int&, int, int)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|46|error: cannot convert 'Fl_Tree_Item*' to 'Fl_Widget*'|
c:\mingw\include\fl\fl_tree_item.h|160|note: initializing argument 4 of 'void Fl_Tree_Item::draw(int, int&, int, Fl_Widget*, Fl_Tree_Item*, const Fl_Tree_Prefs&, int)'|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'Fl_Tree_Item* Fl_Tree_ItemReplace(Fl_Tree_Item*, Fl_Tree_Item*)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|179|error: 'class Fl_Tree_Item' has no member named 'replace'|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'Fl_Tree_Item* Fl_Tree_ItemReplaceChild(Fl_Tree_Item*, Fl_Tree_Item*, Fl_Tree_Item*)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|182|error: 'class Fl_Tree_Item' has no member named 'replace_child'; did you mean 'remove_child'?|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'const Fl_Tree_Prefs& Fl_Tree_ItemGetPrefs(Fl_Tree_Item*)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|249|error: 'class Fl_Tree_Item' has no member named 'prefs'|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'const Fl_Tree* Fl_Tree_ItemGetTree(Fl_Tree_Item*)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|253|error: 'class Fl_Tree_Item' has no member named 'tree'|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'const Fl_Tree_Item* Fl_Tree_ItemFindConstClicked(Fl_Tree_Item*, const Fl_Tree_Prefs&, int)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|343|error: no matching function for call to 'Fl_Tree_Item::find_clicked(const Fl_Tree_Prefs&, int&)'|
c:\mingw\include\fl\fl_tree_item.h|441|note: candidate: 'const Fl_Tree_Item* Fl_Tree_Item::find_clicked(const Fl_Tree_Prefs&) const'|
c:\mingw\include\fl\fl_tree_item.h|441|note: candidate expects 1 argument, 2 provided|
c:\mingw\include\fl\fl_tree_item.h|442|note: candidate: 'Fl_Tree_Item* Fl_Tree_Item::find_clicked(const Fl_Tree_Prefs&)'|
c:\mingw\include\fl\fl_tree_item.h|442|note: candidate expects 1 argument, 2 provided|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'Fl_Tree_Item* Fl_Tree_ItemFindClicked(Fl_Tree_Item*, const Fl_Tree_Prefs&, int)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|346|error: no matching function for call to 'Fl_Tree_Item::find_clicked(const Fl_Tree_Prefs&, int&)'|
c:\mingw\include\fl\fl_tree_item.h|441|note: candidate: 'const Fl_Tree_Item* Fl_Tree_Item::find_clicked(const Fl_Tree_Prefs&) const'|
c:\mingw\include\fl\fl_tree_item.h|441|note: candidate expects 1 argument, 2 provided|
c:\mingw\include\fl\fl_tree_item.h|442|note: candidate: 'Fl_Tree_Item* Fl_Tree_Item::find_clicked(const Fl_Tree_Prefs&)'|
c:\mingw\include\fl\fl_tree_item.h|442|note: candidate expects 1 argument, 2 provided|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'void Fl_TreeSetItemDrawMode(Fl_Tree*, int)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|556|error: 'class Fl_Tree' has no member named 'item_draw_mode'|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'int Fl_TreeGetItemDrawMode(Fl_Tree*)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|559|error: 'class Fl_Tree' has no member named 'item_draw_mode'|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'void Fl_TreeSetWidgetMarginLeft(Fl_Tree*, int)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|563|error: 'class Fl_Tree' has no member named 'widgetmarginleft'; did you mean 'labelmarginleft'?|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'int Fl_TreeGetWidgetMarginLeft(Fl_Tree*)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|566|error: 'class Fl_Tree' has no member named 'widgetmarginleft'; did you mean 'labelmarginleft'?|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'Fl_Tree_Item* Fl_TreeNextVisibleItem(Fl_Tree*, Fl_Tree_Item*, int)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|613|error: 'Fl_Tree_Item* Fl_Tree::next_visible_item(Fl_Tree_Item*, int)' is protected within this context|
c:\mingw\include\fl\fl_tree.h|358|note: declared protected here|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp||In function 'int Fl_TreeExtendSelection(Fl_Tree*, Fl_Tree_Item*, Fl_Tree_Item*, int, int)':|
D:\Users\Administrator\Downloads\Compressed\fltk-c-1.3.3-src\fltk-c-wrapper-treeview.cpp|619|error: no matching function for call to 'Fl_Tree::extend_selection(Fl_Tree_Item*&, Fl_Tree_Item*&, int&, bool)'|
c:\mingw\include\fl\fl_tree.h|359|note: candidate: 'void Fl_Tree::extend_selection(Fl_Tree_Item*, Fl_Tree_Item*)'|
c:\mingw\include\fl\fl_tree.h|359|note: candidate expects 2 arguments, 4 provided|
||=== Build finished: 18 error(s), 0 warning(s) (0 minute(s), 30 second(s)) ===|
fly
Posts: 5
Joined: Nov 08, 2021 6:51

Re: FLTK-C-1.3.3 for FreeBASIC

Post by fly »

I try to rebuild the "fltk-c-1.3.3-src.zip" to generate the static library, but the "fltk-c-1.3.3-src.zip" can't be compiled successfully.
Post Reply