FLTK 1.3.x C Wrapper (obsolete)

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
badidea
Posts: 1394
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby badidea » Jun 15, 2015 21:14

Does FLTK do the memory management? The freeing of memory at exit?

This piece of code takes several second to show and takes > 400 MB of memory:

Code: Select all

var pOutResult = Fl_Multiline_OutputNew(10, 390, 570, 200)
Fl_Input_SetValue(pOutResult, "Line1" & chr(10) & "Line2")
for i as integer = 0 to 24
   Fl_Input_SetValue(pOutResult, *Fl_Input_GetValue(pOutResult) & chr(10) & *Fl_Input_GetValue(pOutResult))
next

But it does work, amazingly.

Edit: One short question, how do I add a vertical scrollbar to it?
D.J.Peters
Posts: 7694
Joined: May 28, 2005 3:28

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby D.J.Peters » Jun 16, 2015 2:16

badidea wrote:Does FLTK do the memory management? The freeing of memory at exit?
On exit all memory will be deallocated for all kinds of applications.

If any Fl_Widget allocates extra memory
you can free it with Fl_Free() but it's really rar
and noted in the FLTK online doc.
badidea wrote:One short question, how do I add a vertical scrollbar to it?
what is "to it" for a Widget ?

If you need help please post a complete code part
that describes the problem not only 3 lines without any context.

Joshy
badidea
Posts: 1394
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby badidea » Jun 16, 2015 6:38

Sorry, with it, I mean the Fl_Multiline_Output.

I can post the whole code, but that is not so interesting. The code is currently a test of the various GUI elements.
Boris the Old
Posts: 132
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby Boris the Old » Jun 16, 2015 14:13

badidea wrote:Question, If I have a Fl_Multiline_Output, how do I add an additional line of text to it?

Edit, found it:

Code: Select all

var pOutResut = Fl_Multiline_OutputNew(10, 390, 570, 200)
Fl_Input_SetValue(pOutResut, "Line1" & chr(10) & "Line2")
Fl_Input_SetValue(pOutResut, *Fl_Input_GetValue(pOutResut) & chr(10) & "Line3")


I'd like to suggest a slightly different approach:

Code: Select all

var pOutResult = Fl_Multiline_OutputNew(10, 390, 570, 200)
var MyTextBuffer = ""
MyTextBuffer = "Line1" & chr(10) & "Line2"
Fl_Input_SetValue(pOutResult, StrPtr(MyTextBuffer))
MyTextBuffer = MyTextBuffer & chr(10) & "Line3"
Fl_Input_SetValue(pOutResult, StrPtr(MyTextBuffer))


This saves reading the data from the Widget each time the text needs to be changed, and allows the text to be manipulated more easily before you re-display it. For example, you might want to make changes to the existing text, or count the Chr(10) characters in order to display the line count in another field.

This approach also makes the code less cluttered and easier to read, which is a great benefit when making changes in the future.

Rod
Lothar Schirm
Posts: 333
Joined: Sep 28, 2013 15:08
Location: Bavaria, Germany

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby Lothar Schirm » Jun 16, 2015 16:29

D.J.Peters wrote:@Lothar you are not a FLTK beginner any more ;)
Next step are leave FBGFX and do it like a FLTK pro. :lol:


Thank you and Rod very much for your help. I am on the way now. In May, I rewrote parts of my fbgfx library for diagrams, and now I have rewritten two of my favorite simulation codes from fbgfx into FLTK code. Everything works fine!
Boris the Old
Posts: 132
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby Boris the Old » Jun 16, 2015 19:21

Lothar Schirm wrote:Thank you and Rod very much for your help. I am on the way now.


As part of our conversion from PowerBasic/EZGUI to FreeBasic/FLTK, we decided to isolate all FLTK code in its own namespace. The main reason for doing this was that our PowerBasic code uses Strings, whereas FLTK uses ZStrings, which would add confusion to our code. Also, FLTK operates at a fairly low level, and we didn't want to clutter our application code with irrelevant details.

Here are some code snippets that show how we use FLTK. If you're interested in learning more about my macros, naming conventions, classes, program structure, etc, I'd be happy to go into more detail.

Warning we make heavy use of macros to simplify our code and make it easy to understand. Treat these samples as pseudo code.

The following code initializes the application and builds the main window:

Code: Select all

'
'-----------------------------------------------
'
BeginExternalSubroutine(subMain)
'
'  package mainline procedure
'
  modApp.exsPackageCode = sSYS_DD
  modApp.exsPackageName = "DVS Data Dictionary"
  modApp.exnMajor       = 6
  modApp.exnMinor       = 1
  modApp.exnBuildNumber = 1
  modApp.exsVersionText = "6.1.1"
  modApp.expCBStart     = ProcPtr(subSignIn)                                   ' 16773 : callback ptr:  activate package startup operations
  modApp.expCBNormal    = ProcPtr(subNormalOperations)                         ' 16774 : callback ptr:  activate normal package operations
  modApp.expCBCrash     = ProcPtr(subCrashRecovery)                            ' 16775 : callback ptr:  activate package crash recovery operations
  modApp.expCBInstall   = ProcPtr(subPackageInstallation)                      ' 16776 : callback ptr:  activate package installation operations
  modApp.expCBRegister  = ProcPtr(subPackageRegistration)                      ' 16789 : callback ptr:  activate package registration
'
  proAppWindow->exsCaption       = "DVS Data Dictionary"                       ' 15328 : caption text
  proAppWindow->exiBaseWidth     = iWINDOW_BASE_WIDTH                          ' 16415 : nominal width of the gui object (pixels)
  proAppWindow->exiBaseHeight    = iWINDOW_BASE_HEIGHT                         ' 16416 : nominal height of the gui object (pixels)
  proAppWindow->exlResizeAllowed = True                                        ' 16405 : true = gui object can be resized
  proAppWindow->expCBDesign      = ProcPtr(subDesignWindow)                    ' 16080 : callback ptr:  design an object
  proAppWindow->subBuild()
'
  modApp.subInitializePackage()
'
  modGui.subEventLoop()                                                        ' process the event loop
'
EndExternalSubroutine


Here are the two include files that define the main window class, followed by selected procedures from the FLTK namespace:

Code: Select all

'===============================================
'
'  file name       :  clsWindow-i.bi
'  description     :  Window Class (Interface)
'  reference       :  6016
'  date generated  :  2015-06-16 14:53
'  configuration   :  FB 1.02.1 (FLTK 1.3.3), 32bit, Linux & Windows
'  copyright       :  1977-2015, Rod Gobby
'
'===============================================
'
BeginClass(clsWindow)
'
BeginClassInterface                    BaseClass(clsGadget)                    ' extends the Gadget Class
'
'===============================================
'
ProtectedInterface
'
'  Protected file handle control blocks
'
'
'  Protected file records
'
'
'  Protected file objects
'
'
'  Protected variables
'
'
'  Protected property variables:  read/write
'
'
'  Protected property variables:  read only
'
'
'  Protected property variables:  write only
'
  ProtectedPointer(prpCBDesign)                                                ' 16080 : callback ptr:  design an object
'
'  Protected procedures
'
'
'===============================================
'
PublicInterface
'
'  Public properties:  read/write
'
'
'  Public properties:  read only
'
'
'  Public properties:  write only
'
  DeclarePublicSetPointer(expCBDesign, prpCBDesign)
'
'  Public procedures
'
  DeclarePublicConstructor
  DeclarePublicDestructor
  DeclarePublicVirtualFunction(funEvents, typInt32)                            ' Virtual:  process the gadget events
  DeclarePublicVirtualSubroutine(subBuild)                                     ' Virtual:  build this object
'
'===============================================
'
EndClassInterface
'
EndClass
'
'===============================================
'  end of  :  clsWindow-i.bi
'===============================================


'===============================================
'
'  file name       :  clsWindow-p.bi
'  description     :  Window Class (Procedures)
'  reference       :  6016
'  date generated  :  2015-06-16 14:53
'  configuration   :  FB 1.02.1 (FLTK 1.3.3), 32bit, Linux & Windows
'  copyright       :  1977-2015, Rod Gobby
'
'===============================================
'
BeginClass(clsWindow)
'
BeginClassProcedures
'
'===============================================
'
'  Public Properties
'
'-----------------------------------------------
'
'  Public properties:  read/write
'
'
'-----------------------------------------------
'
'  Public properties:  read only
'
'
'-----------------------------------------------
'
'  Public properties:  write only
'
  PublicSetPointer(expCBDesign, prpCBDesign)
'
'===============================================
'
'  Procedures
'
'-----------------------------------------------
'
BeginPublicConstructor
'
'  Procedure 1 :
'
'
'
  priReferenceNumber  = iCLASS_TYPE_WINDOW                                     ' 16447 : the entity number for the module, program, package, etc
EndPublicConstructor
'
'-----------------------------------------------
'
BeginPublicDestructor
'
'  Procedure 2 :
'
'
EndPublicDestructor
'
'-----------------------------------------------
'
BeginPublicVirtualFunction(funEvents, typInt32)
'
'  Procedure 3 : Virtual:  process the gadget events
'
'
'
'  not used -- placeholder only
'
EndPublicFunction
'
'-----------------------------------------------
'
BeginPublicVirtualSubroutine(subBuild)
'
'  Procedure 4 : Virtual:  build this object
'
'
  subApplyExternalResizeRules()
  prpWidgetRef = modGui.funWindowCreate(priActualLeft, priActualTop, priActualWidth, priActualHeight, prsCaption)
  modGui.subWindowSetGadgetSelf(prpWidgetRef, prpSelf)                         ' link this window to its widget
  modGui.subWindowSetTerminator(prpWidgetRef)                                  ' link to the window terminator callback
  If IsTrue(prlResizeAllowed) And IsFalse(prlShrinkAllowed) Then
    modGui.subWindowBounds(prpWidgetRef, priBaseWidth, priBaseHeight)          ' set the minimum window size
  End If
  modGui.subWindowBegin(prpWidgetRef)                                          ' begin window design
  PerformCallback(prpCBDesign)                                                 ' design the window
  modGui.subWindowEnd(prpWidgetRef)                                            ' end window design
  modGui.subWindowShow(prpWidgetRef)                                           ' show the application window
EndPublicSubroutine
'
'===============================================
'
EndClassProcedures
'
EndClass
'
'===============================================
'  end of  :  clsWindow-p.bi
'===============================================


Here are FLTK procedures used by the above code, plus a few others:

Code: Select all

'===============================================
'
'  file name       :  modGui-p.bi
'  description     :  Gui Support (FLTK) (Procedures)
'  reference       :  6080
'  date generated  :  2015-06-16 14:59
'  configuration   :  FB 1.02.1 (FLTK 1.3.3), 32bit, Linux & Windows
'  copyright       :  1977-2015, Rod Gobby
'
'===============================================
'
BeginNamespace(modGui)
'
BeginNamespaceProcedures
'
'===============================================
'
'  Procedures
'
'-----------------------------------------------
'
BeginPrivateSubroutineCdecl(subWindowTerminator, BPtr(bvpWindowRef))
'
'  Procedure 3 : Cdecl:  window terminator callback
'
'  bvpWindowRef                        16400 : fltk window reference
'
  If Fl_EventNumber = FL_EVENT_SHORTCUT And Fl_EventKey = FL_Escape Then
    Return                                                                     ' ignore an escape key
  End If
  Fl_WindowHide(bvpWindowRef)                                                  ' terminate the program if no escape key
EndPrivateSubroutine
'
'-----------------------------------------------
'
BeginPrivateFunctionCdecl(funWidgetEventRouter, typInt32, BPtr(bvpWidgetRef), BObj(broGenericGadget, objGadget))
'
'  Procedure 4 : Cdecl:  widget event router
'
'  bvpWidgetRef                        16882 : fltk widget reference
'  broGenericGadget                    16407 : generic gadget object
'
  LocalField(iReturnCode, typInt32)                                            ' 15050 : generic return code
  iReturnCode = iGUI_EVENT_IGNORED                                             ' assume the event is not processed
  If IsObject(broGenericGadget) Then
    If IsTrue(broGenericGadget->exlEventsBlocked) Then
      iReturnCode = iGUI_EVENT_USED                                            ' prevent further propogation of the event
    Else
      iReturnCode = broGenericGadget->funEvents()                              ' process the event
    End If
  End If
  Return iReturnCode
EndPrivateFunction
'
'-----------------------------------------------
'
BeginExternalSubroutine(subEventLoop)
'
'  Procedure 5 : process the event loop
'
'
  Fl_Run
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginExternalFunction(funWindowCreate, typPointer, BVal(bviBaseLeft, typInt32), BVal(bviBaseTop, typInt32), BVal(bviBaseWidth, typInt32), BVal(bviBaseHeight, typInt32), BRef(brsCaption, typString))
'
'  Procedure 9 : create a window
'
'  bviBaseLeft                         16413 : nominal left position of the gui object (pixels)
'  bviBaseTop                          16414 : nominal top position of the gui object (pixels)
'  bviBaseWidth                        16415 : nominal width of the gui object (pixels)
'  bviBaseHeight                       16416 : nominal height of the gui object (pixels)
'  bvsCaption                          15328 : caption text
'
  LocalPointer(pWindowRef)                                                     ' 16400 : fltk window reference
  pWindowRef = Fl_Double_WindowNew2(bviBaseLeft, bviBaseTop, bviBaseWidth, bviBaseHeight, StrPtr(brsCaption))
  Return pWindowRef
EndExternalFunction
'
'-----------------------------------------------
'
BeginExternalSubroutine(subWindowDestroy, BPtr(bvpWindowRef))
'
'  Procedure 10 : destroy a window
'
'  bvpWindowRef                        16400 : fltk window reference
'
  subWindowTerminator(bvpWindowRef)
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginExternalSubroutine(subWindowBounds, BPtr(bvpWindowRef), BVal(bviBaseWidth, typInt32), BVal(bviBaseHeight, typInt32))
'
'  Procedure 11 : set the minimum size of a window
'
'  bvpWindowRef                        16400 : fltk window reference
'  bviBaseWidth                        16415 : nominal width of the gui object (pixels)
'  bviBaseHeight                       16416 : nominal height of the gui object (pixels)
'
  Fl_WindowSizeRange(bvpWindowRef, bviBaseWidth, bviBaseHeight, 0, 0)
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginExternalSubroutine(subWindowShow, BPtr(bvpWindowRef))
'
'  Procedure 12 : show a window
'
'  bvpWindowRef                        16400 : fltk window reference
'
  Fl_WindowShow(bvpWindowRef)
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginExternalSubroutine(subWindowBegin, BPtr(bvpWindowRef))
'
'  Procedure 15 : begin the window design
'
'  bvpWindowRef                        16400 : fltk window reference
'
  Fl_WindowBegin(bvpWindowRef)
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginExternalSubroutine(subWindowEnd, BPtr(bvpWindowRef))
'
'  Procedure 16 : end the window design
'
'  bvpWindowRef                        16400 : fltk window reference
'
  Fl_WindowEnd(bvpWindowRef)
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginExternalSubroutine(subWindowSetTerminator, BPtr(bvpWindowRef))
'
'  Procedure 17 : link the window to the terminator callback
'
'  bvpWindowRef                        16400 : fltk window reference
'
  Fl_WidgetSetCallback0(bvpWindowRef, ProcPtr(subWindowTerminator))
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginExternalSubroutine(subWindowSetGadgetSelf, BPtr(bvpWindowRef), BPtr(bvpSelf))
'
'  Procedure 18 : link a window to its gadget object instance
'
'  bvpWindowRef                        16400 : fltk window reference
'  bvpSelf                             16898 : reference to the current gui object
'
  Fl_WidgetSetUserData(bvpWindowRef, bvpSelf)
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginExternalFunction(funWindowGetGadgetSelf, typPointer, BPtr(bvpWindowRef))
'
'  Procedure 19 : return the window`s gadget object reference
'
'  bvpWindowRef                        16400 : fltk window reference
'
  LocalPointer(pSelf)                                                          ' 16898 : reference to the current gui object
  pSelf = Fl_WidgetGetUserData(bvpWindowRef)
  Return pSelf
EndExternalFunction
'
'-----------------------------------------------
'
BeginExternalSubroutine(subWindowSetToolTip, BPtr(bvpWindowRef), BRef(brsToolTip, typString))
'
'  Procedure 20 : define a window tooltip
'
'  bvpWindowRef                        16400 : fltk window reference
'  bvsToolTip                          16421 : tooltip text:  blank = no tooltip
'
  If NotNull(brsToolTip) Then
    Fl_WidgetSetTooltip(bvpWindowRef, StrPtr(brsToolTip))
  End If
EndExternalSubroutine
'
'===============================================
'
EndNamespaceProcedures
'
EndNamespace
'
'===============================================
'  end of  :  modGui-p.bi
'===============================================
D.J.Peters
Posts: 7694
Joined: May 28, 2005 3:28

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby D.J.Peters » Jun 16, 2015 19:30

badidea
Fl_MultiLine_Output it's readonly for static text.
what you need is a
Fl_Text_Display it's readonly for dynamic text.

Dynamic in this context means you have a kind of AddMoreDynamicText -> Fl_Text_BufferAppend
and if the current dimension are to small to display the "dynamic" text scrollbars are shown.

see also: Fl_Text_Display_WrapMode.bas

Joshy

Code: Select all

#include once "fltk-c.bi"

var win = Fl_Double_WindowNew(100,100)
var tdp = Fl_Text_DisplayNew(10,10,80,80)
var buf = Fl_Text_BufferNew()
Fl_Text_DisplaySetBuffer tdp, buf

Fl_Text_BufferAppend buf,"1234567890 abcdefghijklmnopqrstuvwxyz !§$%&/()=? " & chr(10)
Fl_Text_BufferAppend buf,"1234567890 abcdefghijklmnopqrstuvwxyz !§$%&/()=? " & chr(10)
Fl_Text_BufferAppend buf,"1234567890 abcdefghijklmnopqrstuvwxyz !§$%&/()=? " & chr(10)
Fl_Text_BufferAppend buf,"1234567890 abcdefghijklmnopqrstuvwxyz !§$%&/()=? " & chr(10)
Fl_Text_BufferAppend buf,"1234567890 abcdefghijklmnopqrstuvwxyz !§$%&/()=? " & chr(10)
Fl_Text_BufferAppend buf,"1234567890 abcdefghijklmnopqrstuvwxyz !§$%&/()=? " & chr(10)
Fl_Text_BufferAppend buf,"1234567890 abcdefghijklmnopqrstuvwxyz !§$%&/()=? "

Fl_GroupSetResizable win,tdp
Fl_WindowShow win
Fl_Run
Last edited by D.J.Peters on Jun 18, 2015 2:33, edited 1 time in total.
Boris the Old
Posts: 132
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby Boris the Old » Jun 16, 2015 19:40

D.J.Peters wrote:badidea
Fl_MultiLine_Output it's readonly for static text.


I guess I was implying that with my suggestion -- although static text can be changed under program control. :-)

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

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby D.J.Peters » Jun 16, 2015 19:52

@Rod if you like to present your GUI framework more in detail (not a bad idea)
please do it in a separate Forum thread.

The macro stuff makes FLTK beginners and this FLTK section a litle bit confuse.

I hope you are agree with me.

Joshy
D.J.Peters
Posts: 7694
Joined: May 28, 2005 3:28

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby D.J.Peters » Jun 16, 2015 20:54

badidea wrote:Does FLTK do the memory management?
It's a good question.

How to determine when we have free stuff self ?

If a FLTK function returns a readonly pointer e.g. getXYZ() as const zstring ptr the memory are under control by FLTK.

If FLTK returns a none readonly pointer e.g. getXYZ() as zstring ptr we have to get more infos who have to free the memory.
If the memory under our own control we can use Fl_Free(any pointer).

only one example:

Code: Select all

' Get a copy of the entire contents of the text buffer.
declare function Fl_Text_BufferGetText(byval tb as Fl_Text_Buffer ptr) as zstring ptr
If we are ready with the copy of text we can free it with Fl_Free().

If we forget to free any resources it will be done if the application exit by the OS.

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

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby Boris the Old » Jun 16, 2015 21:13

D.J.Peters wrote:@Rod if you like to present your GUI framework more in detail (not a bad idea)
please do it in a separate Forum thread.

The macro stuff makes FLTK beginners and this FLTK section a litle bit confuse.

I hope you are agree with me.

Joshy


Sure, no problem -- I'm planning on presenting various techniques in Tips & Tricks, but wanted to show how there are benefits to wrapping the FLTK code in a namespace. In large applications, FLTK housekeeping and its use of ZStrings really gets in the way of application code.

Rod
Lothar Schirm
Posts: 333
Joined: Sep 28, 2013 15:08
Location: Bavaria, Germany

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby Lothar Schirm » Jun 17, 2015 14:25

An interesting project, it would be nice to have some contrubutions in Tips and Tricks. But for the moment, I am happy to understand and use FLTK itself, quite sufficient for my small projects.
tinycla
Posts: 121
Joined: Jan 07, 2006 12:51

Fl_Table_Row

Postby tinycla » Jun 19, 2015 11:01

Reading the FLTK docs I've found that Fl_Table_Row could be very usefull for my programs, but I've found examples only on using Fl_Table and Fl_TableEx. Fl_Table_Row is derived from Fl_Table, so I supposed that I could use all the routines of Fl_Table and Fl_TableEx, but this is not true. Maybe some function is still missing in the wrapper, or maybe it is just my fault. Can you please tell me if Fl_Table_Row can be used in FreeBasic? And in case it can be used, could you show me a little example (with row selection, that is what I need)?
Thank you in advance.
D.J.Peters
Posts: 7694
Joined: May 28, 2005 3:28

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby D.J.Peters » Jun 19, 2015 14:30

@tinycla Do you now what a Fl_TableRow is or why you mean a Fl_Table_Row is what you need ?

1) A Fl_Table_Row extends Fl_Table widget that means you have to use all Fl_Table methods with this widget also.

2) A Fl_Table_Row is primary a container where you can place other widgets in it.

I think you have to learn how the Fl_TableEx works at first (isn't easy i know).

Fl_Table_Row

Joshy
tinycla
Posts: 121
Joined: Jan 07, 2006 12:51

Re: FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit.

Postby tinycla » Jun 19, 2015 14:42

D.J.Peters wrote:@tinycla Do you now what a Fl_TableRow is or why you mean a Fl_Table_Row is what you need ?

1) A Fl_Table_Row extends Fl_Table widget that means you have to use all Fl_Table methods with this widget also.

2) A Fl_Table_Row is primary a container where you can place other widgets in it.

I think you have to learn how the Fl_TableEx works at first (isn't easy i know).

Fl_Table_Row

Joshy

You're right, I need to learn how these stuffs work. It's what I'm trying to do, but it seems there is something missing. In C++ it's all clear (at least, I'm confident of having understood how it works), but FB uses a wrapper, and for example I cannot find a way of setting the DrawCellCB callback. The only function that can do that is Fl_TableExSetDrawCellCB, but it doesn't accept a Fl_Table_Row pointer (nor a Fl_Table_RowEx pointer, nor a Fl_Table pointer, only a Fl_TableEx pointer). In C++ you must subclass the method draw_cell, but there isn't such a sub or function in the wrapper (at least, I didn't find it).
I would like to use Fl_Table_Row in place of Fl_Browser, but if I don't find a way of doing so I will stay with Fl_Browser.

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 1 guest