FLTK for DOS

DOS specific questions.
Post Reply
angros47
Posts: 2128
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: 39
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: 2128
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: 2128
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: 2128
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_
Post Reply