FLTK 1.3.x C Wrapper (obsolete)

User contributed sources that have become inactive, deprecated, or generally unusable. But ... we don't really want to throw them away either.
Post Reply
D.J.Peters
Posts: 8631
Joined: May 28, 2005 3:28
Contact:

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

Post by D.J.Peters »

You are right this are missing in the wrapper

Code: Select all

declare function Fl_Table_RowExHandleBase   (byval tex as Fl_Table_RowEx ptr,byval event as Fl_Event) as long
declare function Fl_Table_RowExFindCell     (byval tex as Fl_Table_RowEx ptr,byval ctx as FL_TABLECONTEXT,byval r as long,byval c as long,byref x as long,byref y as long,byref w as long, byref h as long) as long
declare sub      Fl_Table_RowExSetDrawCB    (byval tex as Fl_Table_RowEx ptr,byval cb as Fl_DrawEx)
declare sub      Fl_Table_RowExSetDrawCellCB(byval tex as Fl_Table_RowEx ptr,byval cb as Fl_DrawcellEx)
declare sub      Fl_Table_RowExSetHandleCB  (byval tex as Fl_Table_RowEx ptr,byval cb as Fl_HandleEx)
declare sub      Fl_Table_RowExSetResizeCB  (byval tex as Fl_Table_RowEx ptr,byval cb as Fl_ResizeEx)
I'm sure you can use ther Fl_TableEx for your needs too.

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

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

Post by tinycla »

D.J.Peters wrote:You are right this are missing in the wrapper

Code: Select all

declare function Fl_Table_RowExHandleBase   (byval tex as Fl_Table_RowEx ptr,byval event as Fl_Event) as long
declare function Fl_Table_RowExFindCell     (byval tex as Fl_Table_RowEx ptr,byval ctx as FL_TABLECONTEXT,byval r as long,byval c as long,byref x as long,byref y as long,byref w as long, byref h as long) as long
declare sub      Fl_Table_RowExSetDrawCB    (byval tex as Fl_Table_RowEx ptr,byval cb as Fl_DrawEx)
declare sub      Fl_Table_RowExSetDrawCellCB(byval tex as Fl_Table_RowEx ptr,byval cb as Fl_DrawcellEx)
declare sub      Fl_Table_RowExSetHandleCB  (byval tex as Fl_Table_RowEx ptr,byval cb as Fl_HandleEx)
declare sub      Fl_Table_RowExSetResizeCB  (byval tex as Fl_Table_RowEx ptr,byval cb as Fl_ResizeEx)
I'm sure you can use ther Fl_TableEx for your needs too.

Joshy
OK, how must I do: I've to add those line in fltk-c.bi? Or it's necessary that you release an updated library? It's seems to me that those are the functions needed to use Fl_Table_Row.
Thanl you for the help.
D.J.Peters
Posts: 8631
Joined: May 28, 2005 3:28
Contact:

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

Post by D.J.Peters »

No I must write in C++ first.

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

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

Post by D.J.Peters »

New version available.

added: Fl_Table_RowEx stuff.

Code: Select all

'#############################################
'# class Fl_Table_RowEx extends Fl_Table_Row #
'#############################################
declare function Fl_Table_RowExNew(byval x as long,byval y as long,byval w as long,byval h as long,byval label as const zstring ptr=0) as Fl_Table_RowEx ptr
declare function Fl_Table_RowExHandleBase   (byval tex as Fl_Table_RowEx ptr,byval event as Fl_Event) as long
declare function Fl_Table_RowExFindCell     (byval tex as Fl_Table_RowEx ptr,byval ctx as FL_TABLECONTEXT,byval r as long,byval c as long,byref x as long,byref y as long,byref w as long, byref h as long) as long
declare sub      Fl_Table_RowExSetDrawCB    (byval tex as Fl_Table_RowEx ptr,byval cb as Fl_DrawEx)
declare sub      Fl_Table_RowExSetDrawCellCB(byval tex as Fl_Table_RowEx ptr,byval cb as Fl_DrawcellEx)
declare sub      Fl_Table_RowExSetHandleCB  (byval tex as Fl_Table_RowEx ptr,byval cb as Fl_HandleEx)
declare sub      Fl_Table_RowExSetResizeCB  (byval tex as Fl_Table_RowEx ptr,byval cb as Fl_ResizeEx)
Fl_Table_RowEx01.bas

Code: Select all

#include once "fltk-c.bi"

'test of:
' Fl_Table_Row

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 z as const zstring ptr, _
               byval x as integer,byval y as integer,byval w as integer,byval h as integer)
  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 z as const zstring ptr, _
             byval x as integer,byval y as integer,byval w as integer,byval h as integer, _
             byval fillcolor as Fl_Color=Fl_Write)
  DrawPushClip x,y,w,h
    DrawSetColor fillcolor: 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
  dim as string value
  select case as const context
  case FL_CONTEXT_STARTPAGE
    DrawSetFont(FL_HELVETICA, 16)
  case FL_CONTEXT_COL_HEADER
    value=chr(asc("A")+c)
    DrawHeader(self,strptr(value),x,y,w,h)
  case FL_CONTEXT_ROW_HEADER
    value=str(r)
    DrawHeader(self,strptr(value),x,y,w,h)
  case FL_CONTEXT_CELL
    value=str(datas(r,c))
    if Fl_Table_RowRowSelected(self,r) then
      DrawData(self,strptr(value),x,y,w,h,Fl_Red)
    else
      DrawData(self,strptr(value),x,y,w,h,Fl_White)
    end if
  case else 
    return 0
  end select
  return 1
end function

'
' 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,200, "Resize me ...")
var tbr = Fl_Table_RowExNew(20,20,280,160,"Fl_Table_RowEx01.bas")
Fl_Table_RowExSetDrawCellCB tbr,@DrawCellCB


Fl_TableBegin tbr ' open child list
  ' Rows
  Fl_Table_RowSetRows tbr,MAX_ROWS  ' how many rows
  Fl_TableSetRowHeader tbr, 1       ' enable row headers (along left)
  Fl_TableRowHeightAll tbr,20       ' default height of rows
  Fl_TableSetRowResize tbr, 0       ' disable row resizing
  '  Cols
  Fl_TableSetCols      tbr,MAX_COLS ' how many columns
  Fl_TableSetColHeader tbr, 1       ' enable column headers (along top)
  Fl_TableColWidthAll  tbr,80       ' default width of columns
  Fl_TableSetColResize tbr, 1       ' enable column resizing
Fl_TableEnd tbr ' close child list

Fl_Table_RowSetType tbr,FL_SELECT_SINGLE
Fl_Table_RowSelectRow tbr,2


Fl_GroupSetResizable win,win
Fl_WindowShow win
Fl_Run
D.J.Peters
Posts: 8631
Joined: May 28, 2005 3:28
Contact:

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

Post by D.J.Peters »

@tinycla you can see the Fl_TableRow stuff are the same as from Fl_Table.
The difference are in the DrawCellCB I change the background color if a row are selected.

Code: Select all

...
    if Fl_Table_RowRowSelected(self,r) then ' <-- added
      DrawData(self,strptr(value),x,y,w,h,Fl_Red)
    else
      DrawData(self,strptr(value),x,y,w,h,Fl_White)
    end if
...
With Fl_Table_RowSetType() you can select the type of row selection.
FL_SELECT_NONE, FL_SELECT_SINGLE or FL_SELECT_MULTI

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

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

Post by badidea »

Fl_Text_BufferAppend was indeed what I was looking for, but I ran into a problem. After the press of a button, I want to start some calculations which take several seconds to 1 minute. All this time the GUI is not responsive, is there a way to force the GUI, mainly the text_display, to update, or do I need to launch a separate thread?

See this example code:

Code: Select all

#include once "fltk-c.bi"

const as string LF = chr(10)

dim shared as Fl_Window ptr pWin
dim shared as Fl_Button ptr pButGo
dim shared as Fl_Text_Display ptr  pTextDisplay
dim shared as Fl_Text_Buffer ptr pTextBuffer
dim shared as Fl_Choice ptr pChoDummy

sub logLine(byval pText as zstring ptr)
	Fl_Text_BufferAppend(pTextBuffer, *pText & LF)
end sub

sub heavyDataCruncher()
	for i as integer = 1 to 10
		sleep 500, 1
		logLine(str(i *10) + "%")
		print str(i *10) + "%"
	next
end sub

sub ButtonGo cdecl (byval self as Fl_Widget ptr)
	heavyDataCruncher()
end sub

sub launchGUI()
	'A window
	pWin = Fl_WindowNew(590, 400, "Window")
	'A button
	pButGo = Fl_ButtonNew(50, 100, 280, 50, "Start heavyDataCruncher()")
	Fl_WidgetSetCallback0(pButGo, @ButtonGo)
	'A choice
	pChoDummy = Fl_ChoiceNew(250, 10, 260, 25)
	Fl_Menu_Add(pChoDummy, "1")
	Fl_Menu_Add(pChoDummy, "2")
	Fl_Menu_Add(pChoDummy, "3")
	Fl_ChoiceSetValue(pChoDummy, 0)
	'A textdisplay & buffer
	pTextDisplay = Fl_Text_DisplayNew(10, 190, 570, 200)
	pTextBuffer = Fl_Text_BufferNew()
	Fl_Text_DisplaySetBuffer(pTextDisplay, pTextBuffer)
	Fl_GroupSetResizable(pTextDisplay, pTextDisplay)
	Fl_Text_BufferAppend(pTextBuffer, "test" & LF)
	'Show & Run
	Fl_WindowShow(pWin)
	Fl_Run
end sub

'--------------------------- main program ------------------------------

launchGUI()

end
Any help appreciated.
ike
Posts: 387
Joined: Jan 17, 2011 18:59

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

Post by ike »

Code: Select all


sub heavyDataCruncher()
    for i as integer = 1 to 10
        sleep 500, 1
        logLine(str(i *10) + "%")
        print str(i *10) + "%"


       Fl_Flush


    next
end sub

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

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

Post by D.J.Peters »

@ike Fl_Flush is in this context not the right command.
You need a kind of time sharing try it out Fl_Wait2(0.1) versus Fl_Flush().

Joshy

Code: Select all

#include once "fltk-c.bi"

sub DoSomeThing(v as double)
  while v
    v*=.5
  wend
end sub

sub StuffCB cdecl (self as Fl_Widget ptr)
? "StuffCB begin"
  Fl_WidgetDeactivate self
  for i as integer = 1 to 2000000
    var s = sin(rnd())
    DoSomeThing(s)
  #if 1
    if i mod 1000=0 then Fl_Wait2(0.1)
  #else
    if i mod 1000=0 then Fl_Flush
  #endif
  next
  Fl_WidgetActivate self
? "StuffCB end"
end sub

sub OtherCB cdecl (self as Fl_Widget ptr)
  static as long nTimes=0
  nTimes+=1 
  var label = "OtherCB called " & nTimes & " !"
  Fl_WindowSetLabel Fl_WidgetWindow(self),label

end sub

sub ExitCB cdecl (self as Fl_Widget ptr,btnStuff as any ptr)
  ' calculation running ?
  if Fl_WidgetActive(btnStuff)=0 then
    flMessageTitle "window close event."
    flAlert "note: stuff callback are running !"
  else
    Fl_WindowHide Fl_WidgetAsWindow(self)
  end if
end sub

'
' main
'
const GAB = 10
var win = Fl_WindowNew(400,64)
var bw = Fl_WidgetGetW(win)-3*GAB:bw\=2
var bh = Fl_WidgetGetH(win)-2*GAB
var btnStuff = Fl_ButtonNew(GAB,GAB,BW,BH,"stuff")
var btnOther = Fl_ButtonNew(GAB*2+BW,GAB,BW,BH,"other")
Fl_WidgetSetCallback0 btnStuff,@StuffCB
Fl_WidgetSetCallback0 btnOther,@OtherCB
Fl_WidgetSetCallbackArg win,@ExitCB,btnStuff
Fl_WindowShow win
Fl_Run
tinycla
Posts: 121
Joined: Jan 07, 2006 12:51

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

Post by tinycla »

D.J.Peters wrote:@tinycla you can see the Fl_TableRow stuff are the same as from Fl_Table.
The difference are in the DrawCellCB I change the background color if a row are selected.

Code: Select all

...
    if Fl_Table_RowRowSelected(self,r) then ' <-- added
      DrawData(self,strptr(value),x,y,w,h,Fl_Red)
    else
      DrawData(self,strptr(value),x,y,w,h,Fl_White)
    end if
...
With Fl_Table_RowSetType() you can select the type of row selection.
FL_SELECT_NONE, FL_SELECT_SINGLE or FL_SELECT_MULTI

Joshy
Thank for the update library. I've compiled all the examples, but I get this error on Fl_Table_Row01.bas:
Fl_Table_Row01.o:fake:(.text+0x5504): undefined reference to `Fl_Table_RowExSetDrawCellCB'
Maybe the distribution file is not update?
D.J.Peters
Posts: 8631
Joined: May 28, 2005 3:28
Contact:

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

Post by D.J.Peters »

@tinycla the new version works here.
I'm sure you have a old version of the library floating around.
Image
Do you use windows or linux, 32 or 64-bit ?

Joshy
Last edited by D.J.Peters on Oct 03, 2017 4:12, edited 4 times in total.
D.J.Peters
Posts: 8631
Joined: May 28, 2005 3:28
Contact:

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

Post by D.J.Peters »

Only for fun but a good test of creating/destroying widgets dynamical.

Joshy

Code: Select all

#include once "fltk-c.bi"

sub DoSomeThing(v as double)
  while v: v*=.5 : wend
end sub

sub StuffCB cdecl (self as Fl_Widget ptr)
  Fl_WidgetDeactivate self               ' disable new trigger of button stuff callback
  var win = Fl_WidgetWindow(self)        ' get the window from widget
  var w = Fl_WidgetGetW(win)             ' get current size of the window
  var h = Fl_WidgetGetH(win)
  Fl_WidgetSize win,w,h+10+32            ' resize the window for a new widget
  
  Fl_WindowBegin win                     ' open the window child list 
  var prg = Fl_ProgressNew(10,h,w-20,32) ' add a progress widget (dynamical)
  Fl_WindowEnd win                       ' close the window child list

  const nLoops=500000 ' do any havy task
  dim as long oldValue,newValue,onePercent=nLoops\100
  for i as long = 1 to nLoops
    var s = sin(rnd())
    DoSomeThing(s) : newValue=i\onePercent
    ' update progress bar only if newValue are changed
    if newValue<>oldValue then
      var strValue = str(newValue) & "%"
      Fl_WidgetCopyLabel prg,strptr(strValue) ' set progress text
      Fl_WidgetSetSelectionColor prg,Fl_RGB_Color(255-newValue*2.5,newValue*2.5,0)
      Fl_ProgressSetValue prg,newValue ' set progress value
      oldValue=newValue
    end if
    if i mod 100=0 then Fl_Wait2(0.001) ' time sharing
  next
  Fl_DeleteWidget prg    ' set progress widget on deletion list
  Fl_DoWidgetDeletion    ' delete all widgets on deletion list
  Fl_WidgetSize win,w,h  ' resize the window to old size (without progress widget)
  Fl_WidgetActivate self ' [re]activate the stuff button widget
end sub

sub OtherCB cdecl (self as Fl_Widget ptr)
  static as long nTimes=0
  nTimes+=1 
  var label = "OtherCB called " & nTimes & " !"
  Fl_WindowSetLabel Fl_WidgetWindow(self),label
end sub

sub ExitCB cdecl (self as Fl_Widget ptr,btnStuff as any ptr)
  ' calculation running ?
  if Fl_WidgetActive(btnStuff)=0 then
    flMessageTitle "window close event."
    flAlert "note: stuff callback are running !"
  else
    Fl_WindowHide Fl_WidgetAsWindow(self)
  end if
end sub

'
' main
'
const GAB = 10
var win = Fl_WindowNew(400,64)
' button width
var bw = Fl_WidgetGetW(win)-3*GAB:bw\=2
' button height
var bh = Fl_WidgetGetH(win)-2*GAB
var btnStuff = Fl_ButtonNew(GAB*1+BW*0,GAB,BW,BH,"stuff")
var btnOther = Fl_ButtonNew(GAB*2+BW*1,GAB,BW,BH,"other")
Fl_WidgetSetCallback0 btnStuff,@StuffCB
Fl_WidgetSetCallback0 btnOther,@OtherCB
Fl_WidgetSetCallbackArg win,@ExitCB,btnStuff
Fl_WindowShow win
Fl_Run
tinycla
Posts: 121
Joined: Jan 07, 2006 12:51

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

Post by tinycla »

D.J.Peters wrote:@tinycla the new version works here.
I'm sure you have a old version of the library floating around.

Do you use windows or linux, 32 or 64-bit ?

Joshy
You're right, there was an old version in the FreeBASIC lib folder. Thank you.
badidea
Posts: 2636
Joined: May 24, 2007 22:10
Location: The Netherlands

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

Post by badidea »

I am trying FL_Flush, Fl_Wait and FL_Check. Fl_Flush seems to work better for me.

In the example below, if I select:
* FL_Flush, the choice cannot be changed when the "heavyDataCruncher" is running. Which is fine.
* FLCheck (or Fl_wait), the choice can be changed, but then the "heavyDataCruncher" freezes, which I don't like.

I also added an Widget (De)activate for the button to prevent a new start while running, but doing this for all element seems like a lot of work (the actual code contains more items then this example).

Code: Select all

#include once "fltk-c.bi"

const as string LF = chr(10)

dim shared as Fl_Window ptr pWin
dim shared as Fl_Button ptr pButGo
dim shared as Fl_Text_Display ptr  pTextDisplay
dim shared as Fl_Text_Buffer ptr pTextBuffer
dim shared as Fl_Choice ptr pChoUpdate

sub logLine(byval pText as zstring ptr)
	Fl_Text_BufferAppend(pTextBuffer, *pText & LF)
end sub

sub heavyDataCruncher()
	dim as integer update = Fl_ChoiceGetValue(pChoUpdate)
	Fl_WidgetDeactivate(pButGo)
	for i as integer = 1 to 100
		if (update = 0) then Fl_Flush()
		if (update = 1) then Fl_Check()
		if (update = 2) then Fl_Wait2(0)
		sleep 50, 1
		logLine(i & "%")
		print i & "%"
	next
	Fl_WidgetActivate(pButGo)
end sub

sub ButtonGo cdecl (byval self as Fl_Widget ptr)
	heavyDataCruncher()
end sub

sub launchGUI()
	'A window
	pWin = Fl_WindowNew(590, 400, "Window")
	'A button
	pButGo = Fl_ButtonNew(50, 100, 280, 50, "Start heavyDataCruncher()")
	Fl_WidgetSetCallback0(pButGo, @ButtonGo)
	'A choice
	pChoUpdate = Fl_ChoiceNew(250, 10, 260, 25)
	Fl_Menu_Add(pChoUpdate, "Fl_Flush()")
	Fl_Menu_Add(pChoUpdate, "Fl_Check()")
	Fl_Menu_Add(pChoUpdate, "Fl_Wait2(0)")
	Fl_Menu_Add(pChoUpdate, "Nothing")
	Fl_ChoiceSetValue(pChoUpdate, 0)
	'A textdisplay & buffer
	pTextDisplay = Fl_Text_DisplayNew(10, 190, 570, 200)
	pTextBuffer = Fl_Text_BufferNew()
	Fl_Text_DisplaySetBuffer(pTextDisplay, pTextBuffer)
	Fl_GroupSetResizable(pTextDisplay, pTextDisplay)
	Fl_Text_BufferAppend(pTextBuffer, "test" & LF)
	'Show & Run
	Fl_WindowShow(pWin)
	Fl_Run
end sub

'--------------------------- main program ------------------------------

launchGUI()

end
Another question I have is: Can I 'auto'-scroll the pTextDisplay to the last line?
D.J.Peters
Posts: 8631
Joined: May 28, 2005 3:28
Contact:

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

Post by D.J.Peters »

@badidea here are how to insert text in the Fl_Text_Display and scoll to last insert position.

Joshy

Code: Select all

#include once "fltk-c.bi"

const as string LF = chr(10)

dim shared as Fl_Window ptr pWin
dim shared as Fl_Button ptr pButGo
dim shared as Fl_Text_Display ptr  pTextDisplay
dim shared as Fl_Text_Buffer ptr pTextBuffer
dim shared as Fl_Choice ptr pChoUpdate

sub logLine(byval Text as string)
  Fl_Text_DisplayShowInsertPosition pTextDisplay
  Fl_Text_DisplayInsert pTextDisplay, Text
end sub

sub heavyDataCruncher()
  static as integer i=0
  dim as integer update = Fl_ChoiceGetValue(pChoUpdate)
  Fl_WidgetDeactivate(pButGo)
  for j as integer = 1 to 1000
    i+=1
    logLine(i & !" %\n")
    if (update = 0) then 
      Fl_Flush()
    elseif (update = 1) then 
      Fl_Check()
    elseif (update = 2) then 
      Fl_Wait2(0.1)
    end if
  next
  Fl_WidgetActivate(pButGo)
end sub

sub ButtonGo cdecl (byval self as Fl_Widget ptr)
    heavyDataCruncher()
end sub

sub launchGUI()
    'A window
    pWin = Fl_WindowNew(590, 400, "Window")
    'A button
    pButGo = Fl_ButtonNew(50, 100, 280, 50, "Start heavyDataCruncher()")
    Fl_WidgetSetCallback0(pButGo, @ButtonGo)
    'A choice
    pChoUpdate = Fl_ChoiceNew(250, 10, 260, 25)
    Fl_Menu_Add(pChoUpdate, "Fl_Flush()")
    Fl_Menu_Add(pChoUpdate, "Fl_Check()")
    Fl_Menu_Add(pChoUpdate, "Fl_Wait2(0)")
    Fl_Menu_Add(pChoUpdate, "Nothing")
    Fl_ChoiceSetValue(pChoUpdate, 0)
    'A textdisplay & buffer
    pTextDisplay = Fl_Text_DisplayNew(10, 190, 570, 200)
    pTextBuffer = Fl_Text_BufferNew()
    Fl_Text_DisplaySetBuffer(pTextDisplay, pTextBuffer)
    Fl_Text_DisplayInsert pTextDisplay, !"Test\n"

    Fl_GroupSetResizable(pTextDisplay, pTextDisplay)
    'Show & Run
    Fl_WindowShow(pWin)
    Fl_Run
end sub

'--------------------------- main program ------------------------------

launchGUI()
tinycla
Posts: 121
Joined: Jan 07, 2006 12:51

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

Post by tinycla »

I've completed the program that I was developing for my wife, and I must say that I'm very happy with what I've learned. In the end, I've used Fl_Browser in place of Fl_Table_Row because I didn't found a way for doing what I needed. I like Fltk library very much, but there are things that I miss (of course, this is my fault, I know).
Now the program runs well, it's very fast and responsive, but I'd like to make it better.
One thing that I'd like to add is a widget for the input of a date: for the moment, I've used a standard Fl_Input, and I've done all the test to see if the input contains a valid date in a function, but it would be better if I find a way to make a specialized widget for the date (maybe with 3 inputs for day, month and year). I've seen that anything like that exists, even in C++, but I think that it could be done, only I don't know precisely how to do it. Anybody can help with suggestions?
Post Reply