Raw bindings for FLTK. These are generated using bindgen on the cfltk headers.
toml
[dependencies]
fltk-sys = "1.3"
Example code: ```rust use fltk_sys::; use std::os::raw::;
unsafe extern "C" fn cb(wid: *mut button::FlWidget, data: *mut cvoid) { let frame = data as *mut frame::FlBox; frame::FlBoxsetlabel(frame, "Hello World\0".asptr() as *const _); }
fn main() { unsafe { fl::Flinitall(); image::Flregisterimages(); fl::Fllock(); let win = window::FlWindownew(100, 100, 400, 300, "Window\0".asptr() as *const ); let frame = frame::FlBoxnew(0, 0, 400, 200, std::ptr::null()); let but = button::FlButtonnew(160, 220, 80, 40, "Click\0".asptr() as *const ); window::FlWindowend(win); window::FlWindow_show(win);
button::Fl_Button_set_callback(but, Some(cb), frame as *mut _);
fl::Fl_run();
}
} ```
CMake > 3.14, git and a C++11 compiler. The dev dependencies are basically the same as for fltk-rs.
std::
prefix with the libc
via bindgen (requires adding libc as a dependency).