FOX differentiates itself in the following way from other cross-platform toolkits:
Tk is a cross-platform toolkit but does not have all of the widgets that FOX considers desirable.
Qt up to version 4.5 used to have a licensing model that required a commercial license in some cases where FOX would not.
wxWidgets promotes the use of native widgets on each supported platform.
FLTK is a fast, low-footprint library that supports rapid application development, and requires less code to use, but lacks advanced widgets.
All of these toolkits have some support for programming natively on the classic Mac OS and/or macOS platforms, which FOX currently does not support. FOX uses a technique similar to the Java Swing-style approach to display a graphical user interface to the screen, using only graphical primitives available on that platform, as opposed to the original Java AWT-style approach which used native widgets. This means that applications will have a similar look and feel across platforms. In theory, porting FOX to a new platform should also be easier than implementing support for native widgets. On the downside, it usually means that FOX applications will look and feel different from native applications for those platforms, which some users may find confusing. Also, certain native platform features may not be available immediately, such as comprehensive printing support or internationalized input handling, because they will need to be re-implemented in a cross-platform way before they can be used in FOX. Some applications, like Xfe File Manager, allow changing the color scheme to better integrate with the system's theme colors. On Arch Linux, an app called FOX Control Panel is available to change the color scheme of all FOX applications system-wide. It ships with the main FOX Toolkit package.
Messaging system
FOX offers a transparent bi-directional messaging system. Each widget sends its message to a certain target. Each message is composed by a selector that identifies its kind and an id that is unique and provided by the widget's enumeration. The advantage is that each widget can call a target widget's method in a transparent manner, even if the method does not exist. Vice versa, in the implementation of the individual message handler, since the sender is known, the target can also dispatch a message to the sender. This is a particularly important feature in component oriented software, where components may be written by different people, or even different organizations. The FOX messaging system simplifies the GUI update strategy: during widget update, the widgets can ask from their targets to update them. This means that a command message does not also have to explicitly update any widgets as it is typical. In case an application implements N command messages each updating M widgets, then M*N updates must be executed and at most M*N messages must be implemented. On the other hand, if widgets request for update, only N command messages and at most M update messages are implemented. This strategy separates the GUI update from data changes, making the GUI a real-time reflection of the underlying data structures.
Hello World
The following example creates a FOX application and a dialog with a button on C++:
include "fx.h"
int main
It is also possible to create dialogs with Python 2.2 and Ruby: FXPy
! /usr/bin/env python
from FXPy.fox import * import sys def runme: app = FXApp app.init main = FXMainWindow button = FXButton; app.create main.show app.run if __name__ '__main__': runme
FXRuby require 'fox16' include Fox application = FXApp.new main = FXMainWindow.new FXButton.new application.create main.show application.run
Software built on FOX
CFD-View – a post-processing developed by ESI Group