FLTK for DOS

DOS specific questions.
angros47
Posts: 2331
Joined: Jun 21, 2005 19:04

FLTK for DOS

Post by angros47 »

Can anyone test it?

Code: Select all

#inclib "NX11"
#inclib "freetype"
#inclib "nano-X"
#inclib "mwin"
#inclib "stdcxx"
#inclib "fltk"

extern "c++"
declare function fl_ask(char as const zstring ptr,...) as long
end extern

fl_ask "Test"
(note: in case you are using DosBox, you might have to change it to:

Code: Select all

#inclib "NX11"
#inclib "fre~1"
#inclib "nan~1"
#inclib "mwin"
#inclib "std~1"
#inclib "fltk"
Because DosBox doesn't handle long file names

To compile it, you will need the files:
libfltk.a
libNX11.a
libnano-X.a
libmwin.a
libfreetype.a
libstdcxx.a

You can find them in the archive: https://sourceforge.net/projects/fltk-d ... djgppn.zip, under the "djgpp/lib" directory.
NorbyDroid
Posts: 72
Joined: May 21, 2016 22:55

Re: FLTK for DOS

Post by NorbyDroid »

Tested and it was a success.

I had to make a couple changes to accomodate 8.3 filenames, but it was just a simple rename and a change in the source code.

Only downside is I don't see a way to exit the program, unless I miss something. I press ESC and I get a blank screen with a green mouse cursor and nothing else.
angros47
Posts: 2331
Joined: Jun 21, 2005 19:04

Re: FLTK for DOS

Post by angros47 »

It actually exits the program, and returns to DOS prompt, but it doesn't reset the screen mode.
If you enter some dos commands, they are executed
angros47
Posts: 2331
Joined: Jun 21, 2005 19:04

Re: FLTK for DOS

Post by angros47 »

The headers to use FLTK functions can be found on the thread viewtopic.php?t=31809
angros47
Posts: 2331
Joined: Jun 21, 2005 19:04

Re: FLTK for DOS

Post by angros47 »

Simple demo:

Code: Select all

#include once "Fl_Window.bi"
#include once "Fl_Button.bi"
#include once "Fl_Menu_Bar.bi"

private constructor Fl_Menu_Bar (x as long, y as long, w as long, h as long, l as const zstring ptr)
	base(x,y,w,h,l)
end constructor

dim w as Fl_Window = Fl_Window(440,380,"Window")
	dim b as Fl_button = Fl_button(10,30,150,30,"This is a button")
	dim Menu as Fl_Menu_Bar = Fl_Menu_Bar(0, 0, 440,20)
	Menu.add "File/New"
	Menu.add "File/Open"

w.end_()

w.show


fl.run_
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: FLTK for DOS

Post by demosthenesk »

i compiled with success FLTK109 with fbc110 in DosBox-X with long file names support
-compiles OK
- run exe OK

Unfortunately in FreeDOS13 with doslfn the compilation is succeeded but when i run the exe i get a black screen
angros47
Posts: 2331
Joined: Jun 21, 2005 19:04

Re: FLTK for DOS

Post by angros47 »

Under DosBox does it work?
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: FLTK for DOS

Post by demosthenesk »

angros47 wrote: Aug 05, 2023 19:51 Under DosBox does it work?
i did not test it...
but if you can run doslfn in autoexec.bat it should run...

i avoid simble dosbox because lack of features... i prefer dosbox-x
angros47
Posts: 2331
Joined: Jun 21, 2005 19:04

Re: FLTK for DOS

Post by angros47 »

I mean, FreeBasic cannot compile a program using FLTK under DosBox because the headers use long file names, but the compiled file should work under DosBox.

I personally compiled and tested the example under Windows XP on an old laptop.
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: FLTK for DOS

Post by demosthenesk »

angros47 wrote: Aug 06, 2023 16:37 I mean, FreeBasic cannot compile a program using FLTK under DosBox because the headers use long file names, but the compiled file should work under DosBox.

I personally compiled and tested the example under Windows XP on an old laptop.
if in DosBox run doslfn programm from autoexec,bat you have support for long file names, that was i said...
in DosBox-X there is no need it has this feature...

the same for FreeDos...you have to run doslfn
in FreeDos13 i could compile but i got blank screen at run
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: FLTK for DOS

Post by demosthenesk »

i tried to run a FLTK app in DOSBOX with success
no tried compile

you have to install csdpmi5b in your C:\ drive and add to PATH on dosbox.conf file

my settings

[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.
@ECHO OFF
MOUNT C /home/user/Bin/DISTROS/DOS/DOSBOX-DEVEL/C
C:\WINDOWS\SMARTDRV.EXE
PATH C:\WINDOWS;C:\csdpmi5b\BIN;
SET TEMP=C:\WINDOWS\TEMP
C:
NOSHARE.COM /I
angros47
Posts: 2331
Joined: Jun 21, 2005 19:04

Re: FLTK for DOS

Post by angros47 »

Then, it makes me think your real DOS machine has a video card not supported (or not configured correctly). Keep in mind that it is not based on the FreeBasic graphich library, but on Nano-X, so the requirements might not be the same
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: FLTK for DOS

Post by demosthenesk »

angros47 wrote: Aug 06, 2023 17:32 Then, it makes me think your real DOS machine has a video card not supported (or not configured correctly). Keep in mind that it is not based on the FreeBasic graphich library, but on Nano-X, so the requirements might not be the same
my FreeDOS13 is in vmware
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: FLTK for DOS

Post by demosthenesk »

Another question not relative to FLTK109 directly...

i want to compile FLTK1.3.8 for DOS (DOSBOX-X)
how to do it ?
angros47
Posts: 2331
Joined: Jun 21, 2005 19:04

Re: FLTK for DOS

Post by angros47 »

I took it from XFDOS, perhaps by looking at that project and at its source codes you can find more details on how to compile it
Post Reply