Dup Ver Goto 📝

Installing Python Fltk

PT2/lang/python/fltk python fltk does not exist
To
31 lines, 102 words, 852 chars Page 'Installation' does not exist.

While I like Qt and PySide, for small things (like popping up an alert box), PySide6 takes a little while to start up. Tk is one option, and Fltk is another.

Debian/Ubuntu

This works on 24.04 LTS. From the official webpage:

sudo apt update
sudo apt install libfltk1.3-dev g++ python3-dev python3-setuptools subversion swig
svn checkout https://svn.code.sf.net/p/pyfltk/code/trunk pyfltk-code
cd pyfltk-code/pyfltk/
python3 setup.py swig
python3 setup.py build
sudo python3 setup.py install

Simple Example

Just to test it's working:

from fltk import *
import sys

window = Fl_Window(300,180)
box = Fl_Box(20,40,260,100,"Hello, World!")
box.box(FL_UP_BOX)
box.labelsize(36)
box.labelfont(FL_BOLD+FL_ITALIC)
box.labeltype(FL_SHADOW_LABEL)
window.end()
window.show(sys.argv)
Fl.run()