FLTK 1.3.x C Wrapper (obsolete)

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK C Wrapper (Fast Light Toolkit v 1.3.3)

Postby Boris the Old » Feb 26, 2015 20:54

@Joshy

In the Member Enumeration Documentation for Fl_Widget there is a reference to a GROUP_RELATIVE flag. Its description is: "position this widget relative to the parent group, not to the window".

[edit] This flag is referenced via protected methods in "Fl_Widget.H". Is this a real feature and, if so, how can it be activated? There seem to be no wrapper commands to set/get this particular flag. [/edit]

It's almost impossible to work with dynamic layouts when all positions are relative to the window, instead of being relative to the groups that contain the widgets.

Thanks

Rod
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: FLTK C Wrapper (Fast Light Toolkit v 1.3.3)

Postby ike » Mar 13, 2015 14:27

How do I change COL and ROW header size in FL_TABLE?

Fl_TableSetColWidth(T.tbl, -1, 11)

-1 doesnot work, col and rows are numerated from 0
D.J.Peters
Posts: 8123
Joined: May 28, 2005 3:28
Contact:

Re: FLTK C Wrapper (Fast Light Toolkit v 1.3.3)

Postby D.J.Peters » Mar 13, 2015 17:30

Boris the Old wrote:It's almost impossible to work with dynamic layouts when all positions are relative to the window, instead of being relative to the groups that contain the widgets.
may be: WidgetCoords=YourCoords+GroupCoords relative to the window

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

Re: FLTK C Wrapper (Fast Light Toolkit v 1.3.3)

Postby D.J.Peters » Mar 13, 2015 18:06

ike wrote:How do I change COL and ROW header size in FL_TABLE?
Fl_TableSetColHeaderHeight
Fl_TableSetRowHeaderWidth

Joshy

Code: Select all

#include once "fltk-c.bi"

const MAX_ROWS = 32
const MAX_COLS = 26

dim shared as integer datas(MAX_ROWS-1,MAX_COLS-1)

sub DrawHeader(byval tbl as Fl_Table ptr,byval s as string, _
               byval x as integer,byval y as integer,byval w as integer,byval h as integer)
  dim as zstring ptr z = strptr(s)
  DrawPushClip(x,y,w,h)
    DrawBox(BoxType(FL_THIN_UP_BOX), x,y,w,h, Fl_TableGetRowHeaderColor(tbl))
    DrawSetColor(FL_BLACK)
    DrawStrBox(z, x,y,w,h, FL_ALIGN_CENTER)
  DrawPopClip()
end sub

sub DrawData(byval tbl as Fl_Table ptr,byval s as string, _
             byval x as integer,byval y as integer,byval w as integer,byval h as integer)
  dim as zstring ptr z = strptr(s)
  DrawPushClip(x,y,w,h)
    DrawSetColor(FL_WHITE): DrawRectFill(x,y,w,h)
    DrawSetColor(FL_GRAY0): DrawStrBox(z, x,y,w,h, FL_ALIGN_CENTER)
    DrawSetColor(Fl_BLACK): DrawRect(x,y,w,h)
  DrawPopClip()
end sub

function DrawCellCB cdecl (byval self as any ptr,byval context as Fl_TableContext, _
                           byval r as integer,byval c as integer, _
                           byval x as integer,byval y as integer,byval w as integer,byval h as integer) as integer
  '? r & "," & c & " " & x,y,w,h
  select case as const context
  case FL_CONTEXT_STARTPAGE
    DrawSetFont(FL_HELVETICA, 16)
  case FL_CONTEXT_COL_HEADER
    DrawHeader(self,chr(asc("A")+c),x,y,w,h)
  case FL_CONTEXT_ROW_HEADER
    DrawHeader(self,str(r),x,y,w,h)
  case FL_CONTEXT_CELL
    DrawData(self,str(datas(r,c)),x,y,w,h)
  case else
    return 0
  end select
  return 1
end function

sub ColSliderCB cdecl(byval self as FL_WIDGET ptr,byval tbl as any ptr)
  Fl_TableSetColHeaderHeight tbl,200*Fl_ValuatorGetValue(cptr(Fl_Valuator ptr,self))
end sub
sub RowSliderCB cdecl(byval self as FL_WIDGET ptr,byval tbl as any ptr)
  Fl_TableSetRowHeaderWidth tbl,200*Fl_ValuatorGetValue(cptr(Fl_Valuator ptr,self))
end sub

'
' main
'
for r as integer=0 to MAX_ROWS-1
  for c as integer=0 to MAX_COLS-1
    datas(r,c)=rnd*1000
  next
next

var win = Fl_Double_WindowNew(320,240, "Fl_TableEx02.bas")
var tbl = Fl_TableExNew(20,20,280,160,"Fl_TableEx")
Fl_TableExSetDrawCellCB tbl,@DrawCellCB
Fl_TableBegin(tbl)              ' open child list
  ' Rows
  Fl_TableSetRows(tbl,MAX_ROWS)   ' how many rows
  Fl_TableSetRowHeader(tbl,1)     ' enable row headers (along left)
  Fl_TableRowHeightAll(tbl,20)    ' default height of rows
  Fl_TableSetRowResize(tbl,0)     ' disable row resizing
  '  Cols
  Fl_TableSetCols(tbl,MAX_COLS)   ' how many columns
  Fl_TableSetColHeader(tbl,1)     ' enable column headers (along top)
  Fl_TableColWidthAll(tbl,80)     ' default width of columns
  Fl_TableSetColResize(tbl,1)     ' enable column resizing
Fl_TableEnd(tbl)                ' close child list

var colsld = Fl_Hor_SliderNew(20,200,100,24,"col size")
Fl_WidgetSetCallbackArg colsld,@colSliderCB,tbl

var rowsld = Fl_Hor_SliderNew(200,200,100,24,"row size")
Fl_WidgetSetCallbackArg rowsld,@rowSliderCB,tbl


Fl_GroupSetResizable(win,win)
Fl_WindowShow(win)
Fl_Run
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: FLTK C Wrapper (Fast Light Toolkit v 1.3.3)

Postby ike » Mar 13, 2015 18:45

FLTK wrapper is very good I am using it 4 months everyday.

Working on geotechnical well logging program, it is like vector editing (like Inkskape) but for drafting well logs

here is screen shoot

http://s21.postimg.org/clz81z8h3/WELL.png

http://postimg.org/image/cw7c330b1/
D.J.Peters
Posts: 8123
Joined: May 28, 2005 3:28
Contact:

Re: FLTK C Wrapper (Fast Light Toolkit v 1.3.3)

Postby D.J.Peters » Mar 13, 2015 20:09

ike wrote:FLTK wrapper is very good
Really this is new for me.

I should give it a try. :lol:

The logging program looks good how many shared vars ? ;)

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

Re: FLTK C Wrapper (Fast Light Toolkit v 1.3.3)

Postby ike » Mar 13, 2015 22:13

I dont like using shared vars,

I have to do it only if I am using FLTK wrapper

Joking, I am using namespaces
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK C Wrapper (Fast Light Toolkit v 1.3.3)

Postby Boris the Old » Mar 14, 2015 0:00

D.J.Peters wrote:
Boris the Old wrote:It's almost impossible to work with dynamic layouts when all positions are relative to the window, instead of being relative to the groups that contain the widgets.
may be: WidgetCoords=YourCoords+GroupCoords relative to the window

Joshy


That's what we're doing. We've changed all our GUI classes, but it would have been nice to use the built-in FLTK feature.

ike wrote:I dont like using shared vars,

I have to do it only if I am using FLTK wrapper

Joking, I am using namespaces


Same here. We use classes where we need multiple instances of a module, and namespaces for single instance modules.

Our previous code used classes for everything. However, FB does not have the ability to specify the address of a method, which creates problems when setting up callback addresses for FLTK. Namespaces are an easy way of getting around this problem.

We've wrapped a subset of FLTK widgets in our own classes. This simplifies our code greatly, since we only use about 20% of FLTK's capabilities. However, these classes do not contain any FLTK code, but use calls to procedures in a namespace that contains the calls to FLTK. The advantage of this is that we don't have to use any ZStrings in our application code, and the code in our classes doesn't need to know about FLTK. We also use a single procedure in the namespace for handling all callbacks. The user data for each widget holds the address of a GUI class instance, so all this callback procedure does is retrieve the address and branch to the Event method in the class. There's no need to have shared or global variables, or long sequences of Select/Case statements.

Rod
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: FLTK C Wrapper (Fast Light Toolkit v 1.3.3)

Postby ike » Mar 14, 2015 0:41

Rod, you gave me idea of using classes and namespace, but it looks you make it better, because you dont have to use ZString

I also build dirty form editor, when I have time to make it better - cleaner I will share it here

http://postimg.org/image/eqgify08f/full/

It is not VB6 but that was only way to arange 1000 widgets on 50+ forms
D.J.Peters
Posts: 8123
Joined: May 28, 2005 3:28
Contact:

Re: FLTK C Wrapper (Fast Light Toolkit v 1.3.3)

Postby D.J.Peters » Mar 14, 2015 16:14

@Rod I would do it like this.

Joshy

Code: Select all

#include once "fltk-c.bi"

function RelX(byval parent as FL_Widget ptr,byval x as integer) as integer
  if parent=0 then return x
  if Fl_WidgetAsWindow(parent)  then return x
  if Fl_WidgetAsGroup(parent)=0 then return x
  return x+Fl_WidgetGetX(parent)
end function

function RelY(byval parent as FL_Widget ptr,byval y as integer) as integer
  if parent=0 then return y
  if Fl_WidgetAsWindow(parent)  then return y
  if Fl_WidgetAsGroup(parent)=0 then return y
  return y+Fl_WidgetGetY(parent)
end function

var win = Fl_WindowNew(320,200)
Fl_ButtonNew RelX(win,50),RelY(win,50),120,24,"window relative"
var grp = Fl_GroupNew(50,50,220,100)
Fl_ButtonNew RelX(grp,50),RelY(grp,50),120,24,"group realative"
Fl_WindowShow win
Fl_Run
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: FLTK C Wrapper (Fast Light Toolkit v 1.3.3)

Postby Boris the Old » Mar 14, 2015 22:30

D.J.Peters wrote:@Rod I would do it like this.

Joshy


Thanks for the suggestion, but we've already done something like it. :-)

We have a "Gadget" base class, similar to the FLTK Widget class, that contains properties, methods, protected variables, and protected procedures, that are common to the derived classes. Here are some code fragments that show how we have wrapped FLTK into our own classes. By using a single base class (with virtual methods) for all our derived GUI classes, we can reference any GUI object as type "objGadget".

Warning: The following code is machine generated and makes heavy use of macros, so it may look a little strange. Also, I've removed the machine generated comments. However, I like to use long meaningful names, so these code fragments are easy to read.

This fragment creates a window and begins to populate it:

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)
  modApp.expCBNormal    = ProcPtr(subNormalOperations)
  modApp.expCBCrash     = ProcPtr(subCrashRecovery)
  modApp.expCBInstall   = ProcPtr(subPackageInstallation)
  modApp.expCBRegister  = ProcPtr(subPackageRegistration)
'
  proAppWindow->exsCaption       = "DVS Data Dictionary"
  proAppWindow->exiBaseWidth     = iWINDOW_BASE_WIDTH
  proAppWindow->exiBaseHeight    = iWINDOW_BASE_HEIGHT
  proAppWindow->exlResizeAllowed = True
  proAppWindow->expCBDesign      = ProcPtr(subDesignWindow)
  proAppWindow->subBuild()
'
  modApp.subInitializePackage()
'
  modGui.subEventLoop()
'
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginPrivateSubroutine(subDesignWindow)
'
'  design the application window
'
  proAppMenuPanel->exoParent     = proAppWindow
  proAppMenuPanel->exiBaseLeft   = 0
  proAppMenuPanel->exiBaseTop    = 0
  proAppMenuPanel->exiBaseWidth  = iGUI_WINDOW_MENUPANEL_WIDTH
  proAppMenuPanel->exiBaseHeight = proAppWindow->exiActualHeight
  proAppMenuPanel->expCBDesign   = ProcPtr(subDesignMenuPanel)
  proAppMenuPanel->subBuild()
'
  proAppStatusPanel->exoParent     = proAppWindow
  proAppStatusPanel->exiBaseLeft   = iGUI_WINDOW_MENUPANEL_WIDTH
  proAppStatusPanel->exiBaseTop    = proAppWindow->exiActualHeight - iGUI_WINDOW_STATUSPANEL_HEIGHT
  proAppStatusPanel->exiBaseWidth  = proAppWindow->exiActualWidth - iGUI_WINDOW_MENUPANEL_WIDTH
  proAppStatusPanel->exiBaseHeight = iGUI_WINDOW_STATUSPANEL_HEIGHT
  proAppStatusPanel->expCBDesign   = ProcPtr(subDesignStatusPanel)
  proAppStatusPanel->subBuild()
'
  proAppTaskPanel->exoParent        = proAppWindow
  proAppTaskPanel->exiBaseLeft      = iGUI_WINDOW_MENUPANEL_WIDTH
  proAppTaskPanel->exiBaseTop       = 0
  proAppTaskPanel->exiBaseWidth     = proAppWindow->exiActualWidth - iGUI_WINDOW_MENUPANEL_WIDTH
  proAppTaskPanel->exiBaseHeight    = proAppWindow->exiActualHeight - iGUI_WINDOW_STATUSPANEL_HEIGHT
  proAppTaskPanel->exlResizeAllowed = True
  proAppTaskPanel->expCBDesign      = ProcPtr(subDesignTaskPanel)
  proAppTaskPanel->subBuild()
'
EndPrivateSubroutine
'
'-----------------------------------------------
'
BeginPrivateSubroutine(subDesignMenuPanel)
'
'  design the application menu panel
'
  proAppMenuTitle->exoParent                  = proAppMenuPanel
  proAppMenuTitle->exiHorizontalAlignmentMode = iGUI_ALIGN_FILL
  proAppMenuTitle->exiVerticalAlignmentMode   = iGUI_ALIGN_START
  proAppMenuTitle->exiBaseHeight              = iGUI_ROW_HEIGHT
  proAppMenuTitle->exsCaption                 = "Menu"
  proAppMenuTitle->subBuild()
'
  proAppMenuBar->exoParent                  = proAppMenuPanel
  proAppMenuBar->exiHorizontalAlignmentMode = iGUI_ALIGN_FILL
  proAppMenuBar->exiVerticalAlignmentMode   = iGUI_ALIGN_FILL
  proAppMenuBar->exiMarginTop               = iGUI_ROW_HEIGHT
  proAppMenuBar->exlResizeAllowed           = True
  proAppMenuBar->expCBDesign                = ProcPtr(subDesignMenuBar)
  proAppMenuBar->subBuild()
'
EndPrivateSubroutine


This fragment shows how a MenuBar (FLTK Tree) object is built:

Code: Select all

'
'-----------------------------------------------
'
BeginPublicVirtualSubroutine(subBuild)
'
'  Procedure 4 : Virtual: build this menubar object
'
'
  proParent->subAttachChild(prpSelf)
'
  subApplyExternalResizeRules()
  prpWidgetRef = modGui.funTreeCreate(priActualLeft, priActualTop, priActualWidth, priActualHeight)
'
  modGui.subWidgetSetGadgetSelf(prpWidgetRef, prpSelf)
  modGui.subWidgetSetEventCallback(prpWidgetRef)
  modGui.subWidgetSetBorder(prpWidgetRef, prvBorderStyle)
  modGui.subTreeRootLabel(prpWidgetRef, prsCaption)
  subSetexvForegroundColour()
  subSetexvBackgroundColour()
  If IsTrue(prlResizeAllowed) Then
    modGui.subPanelSetResizable(proParent, prpSelf)
  End If
'
  modGui.subPanelDesignBegin(prpWidgetRef)
  modGui.subCallbackRouter(prpCBDesign)
  modGui.subPanelDesignEnd(prpWidgetRef)
'
EndPublicSubroutine


This fragment shows how an object is positioned and sized within its parent panel:

Code: Select all

'
'-----------------------------------------------
'
BeginProtectedSubroutine(subApplyExternalResizeRules)
'
'  Procedure 16 : position this gadget relative to its parent
'
'
  LocalField(iParentWidth, typInt32)
  LocalField(iParentHeight, typInt32)
  LocalField(iParentPadding, typInt32)
  LocalField(iDisplayWidth, typInt32)
  LocalField(iDisplayHeight, typInt32)
  LocalField(iParentLeft, typInt32)
  LocalField(iParentTop, typInt32)
'
  If priReferenceNumber = iCLASS_TYPE_WINDOW Then
    iDisplayWidth   = modGui.funGetDisplayWidth()
    iDisplayHeight  = modGui.funGetDisplayHeight()
    priActualLeft   = (iDisplayWidth  - priBaseWidth) \ 2
    priActualTop    = (iDisplayHeight - priBaseHeight) \ 2
    priActualWidth  = priBaseWidth
    priActualHeight = priBaseHeight
    Return
  End If
'
  If proParent->exiReferenceNumber = iCLASS_TYPE_WINDOW Then
    iParentLeft  = 0
    iParentTop   = 0
  Else
    iParentLeft  = proParent->exiActualLeft
    iParentTop   = proParent->exiActualTop
  EndIf
  iParentWidth   = proParent->exiActualWidth
  iParentHeight  = proParent->exiActualHeight
  iParentPadding = proParent->exiPadding
'
  Select Case priHorizontalAlignmentMode
    Case iGUI_ALIGN_FILL
      priActualLeft  = iParentLeft + iParentPadding + priMarginLeft
      priActualWidth = iParentWidth - iParentPadding - priMarginLeft - priMarginRight - iParentPadding
    Case iGUI_ALIGN_START
      priActualLeft  = iParentLeft + iParentPadding + priMarginLeft
      priActualWidth = priBaseWidth
    Case iGUI_ALIGN_END
      priActualLeft  = iParentLeft + iParentWidth - iParentPadding - priMarginRight - priBaseWidth
      priActualWidth = priBaseWidth
    Case iGUI_ALIGN_CENTRE
      priActualLeft  = iParentLeft + (iParentWidth - priBaseWidth) \ 2
      priActualWidth = priBaseWidth
    Case Else
      priActualLeft  = iParentLeft + iParentPadding + priMarginLeft + priBaseLeft
      priActualWidth = priBaseWidth
  End Select
'
  Select Case priVerticalAlignmentMode
    Case iGUI_ALIGN_FILL
      priActualTop    = iParentTop + iParentPadding + priMarginTop
      priActualHeight = iParentHeight - iParentPadding - priMarginTop - priMarginBottom - iParentPadding
    Case iGUI_ALIGN_START
      priActualTop    = iParentTop + iParentPadding + priMarginTop
      priActualHeight = priBaseHeight
    Case iGUI_ALIGN_END
      priActualTop    = iParentTop + iParentHeight - iParentPadding - priMarginBottom - priBaseHeight
      priActualHeight = priBaseHeight
    Case iGUI_ALIGN_CENTRE
      priActualTop    = iParentTop + (iParentHeight - priBaseHeight) \ 2
      priActualHeight = priBaseHeight
    Case Else
      priActualTop    = iParentTop + iParentPadding + priMarginTop + priBaseTop
      priActualHeight = priBaseHeight
  End Select
'
EndProtectedSubroutine


And finally, here are a few of procedures in the FLTK namespace module:

Code: Select all

'
'-----------------------------------------------
'
BeginExternalSubroutine(subCallbackRouter, BPtr(bvpProcedurePtr))
'
'  Procedure 3 : package callback router
'
'
  LocalSubroutinePointer(pCallbackPtr)
'
  If IsTrue(bvpProcedurePtr) Then
    pCallbackPtr = bvpProcedurePtr
    PerformProcedure(pCallbackPtr)
  End If
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginExternalFunction(funEventRouter, typInt32, BPtr(bvpWidgetRef), BObj(broGenericGadget, objGadget))
'
'  Procedure 4 : FLTK event router
'
'
  LocalField(iReturnCode, typInt32)
'
  iReturnCode = iGUI_EVENT_IGNORED
  If IsObject(broGenericGadget) Then
    iReturnCode = broGenericGadget->funEvents()
  End If
  Return iReturnCode
EndExternalFunction
'
'-----------------------------------------------
'
BeginExternalSubroutine(subWidgetSetLabel, BPtr(bvpWidgetRef), BRef(brsCaption, typString), BVal(bviLabelAlignment, typInt32))
'
'  Procedure 37 : set the widget label text and its alignment
'
'
  If NotNull(brsCaption) Then
    Fl_WidgetCopyLabel(bvpWidgetRef, StrPtr(brsCaption))
    Fl_WidgetSetAlign(bvpWidgetRef, bviLabelAlignment)
  End If
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginExternalSubroutine(subPanelSetResizable, BObj(broParent, objGadget), BObj(broChild, objGadget))
'
'  Procedure 41 : define a child panel to be resizable
'
'
  Fl_GroupSetResizable(broParent->expWidgetRef, broChild->expWidgetRef)
EndExternalSubroutine
'
'-----------------------------------------------
'
BeginExternalSubroutine(subTreeRootLabel, BPtr(bvpWidgetRef), BRef(brsCaption, typString))
'
'  Procedure 43 : assign a label to the root node
'
'
  If NotNull(brsCaption) Then
    Fl_TreeRootLabel(bvpWidgetRef, StrPtr(brsCaption))
  Else
    Fl_TreeSetShowRoot(bvpWidgetRef, Nothing)
  End If
EndExternalSubroutine
Boris the Old
Posts: 139
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 » Mar 17, 2015 18:16

How do I prevent the Esc key from terminating my programs? It has the same effect as Alt+F4.

I've searched the FLTK documentation and forums, and tried intercepting the Esc key in Callback procedures, but have been unable to find a solution.

Thanks

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

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

Postby D.J.Peters » Mar 17, 2015 20:08

You can ignore the ESCAPE key like this.

Joshy

Code: Select all

#include once "fltk-c.bi"

sub WindowCB cdecl (byval self as FL_WIDGET ptr)
  if (Fl_EventNumber()=FL_EVENT_SHORTCUT andalso Fl_EventKey()=FL_Escape) then
    return ' ignore Escape
  end if
  beep
  Fl_WindowHide Fl_WidgetAsWindow(self)
end sub
'
' main
'
var Win = Fl_WindowNew(320,200)
Fl_WidgetSetCallback0 Win, @WindowCB
Fl_WindowShow Win
Fl_Run
Boris the Old
Posts: 139
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 » Mar 17, 2015 20:37

@Joshy

Thanks, that works fine. I was missing the FL_EVENT_SHORTCUT portion.

It's not always obvious what things go together :-)

Rod
Boris the Old
Posts: 139
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 » Mar 22, 2015 22:59

@Joshy

I'm having a problem with the Tree widget that I don't understand. I'm making use of a tree structure, on the left of the screen, to act as a menu rather than use a standard menu bar -- it's a long story :-)

Everything works fine from a functional point of view. I can display the tree and use the events to invoke program functions. However, there are a number of things about the Tree widget that I can't figure out from "fltk-c.bi". And the online FLTK documentation makes no sense to me, since I don't use "C".

How do I make use of the following statements to modify the colour and font of individual TreeItem labels? Presumably they are used in conjunction with other statements, since they make no direct reference to the TreeItem pointer.

Code: Select all

declare sub      Fl_TreeSetItemLabelFGColor(byval tr as Fl_Tree ptr,byval c as Fl_Color)
declare sub      Fl_TreeSetItemLabelFont(byval tr as Fl_Tree ptr,byval f as Fl_Font)
declare sub      Fl_TreeSetItemLabelSize(byval tr as Fl_Tree ptr,byval s as FL_FONTSIZE)


Thanks

Rod

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 4 guests