EuGTK - a GTK3 Library for Euphoria 4.x

EuGTK is an easy-to-use and very complete, up-to-date 'toolkit' for creating your own GUI programs using GTK3 and the Euphoria programming language on Linux, Windows and OS X.

Euphoria is a fast interpreted language (several times faster than Python, for example), free and open source, with the option to automatically translate your Euphoria code into C, and then compile it to an executable, which runs even faster.

The latest versions of Euphoria can be downloaded from OpenEuphoria.org. Eu version 4.1 is required, 4.1 Beta 2 is recommended.

The latest version of EuGTK (Nov 13, 2017) will be at the DOWNLOAD link below. This download contains no dangerous executables, everything is written in plain-text Euphoria. No compiling is required.

Euphoria and the EuGTK library are free to use (GPL3) for any purpose. Extensive html docs - pretty much a complete book on GTK programming with Euphoria - are included with the downloads. Please take the time to read them.

Euphoria itself runs in text mode in a terminal; EuGTK adds a GUI, which can be built manually, with simple code as shown in the screenshot here. No tricky sizing or layout code is required, and all that crazy type-casting you have to do with other programming languages doesn't exist!

If you prefer, Glade can be used to visually design your program, which can then  load your user interface with just one line of code!


Download Links:

  EuGtk 4.14.1    Aug 1, 2018, tested with Gtk3.18 on Linux, Gtk3.22 on Windows (64-bit platform only), reported to run on OS-X as well. 15.7 meg.
     
Pete Eberlein's excellent cross-platform editor, written in Euphoria, uses EuGTK for the Linux/OS X GUI. Download it here:  https://github.com/peberlein/WEE/

A one-step install script for Euphoria 4.1 on Linux is available from github.



Platforms:

Linux is the native platform for GTK. The needed GTK3 libraries are usually installed as part of the distro, or can be added with a simple apt-get command. No setup is required, just drag the demos folder from the .gz, and drop it into your home folder. I currently prefer Mint Linux.

Windows:: I have tested EuGTK with Windows 7 and the 64-bit version of the Gtk libraries for Windows. Sorry, I do not have a 32-bit Windows installation to test. Instructions for downloading the necessary GTK libraries for Windows are included in the readme. This latest Gtk3.22 library for Windows works very nicely!

OS X is also reported to work. I don't have a computer to test this with, but others have reported success.
First, install MacPorts, and then the GTK3 library with this command: sudo port install gtk3
That should eventually install the library to /opt/local/lib/libgtk-3.dylib.

Raspberry Pi 3: I've had good results running Euphoria on the Raspberry Pi 3, a cheap ($37.00) and tiny computer running Linux (Raspbian or Ubuntu).
See the wiki at OpenEuphoria.org and WiringPi

EuGTK will automatically detect and use the appropriate libraries. No changes in settings are needed to move programs from one platform to another. You can even "cross-compile", if you wish, to save time by compiling your Raspberry Pi programs on a faster Linux desktop computer. Installation and cross-compiling instructions can be found on the Openeuphoria.org website.


 Contents of EuGTK
  1. GtkEngine.e
  2. GtkEnums.e -- declares the GTK3 constants.
  3. GtkPrinter.e -- generic printer routines, many reports can be produced using only one or two lines of code.
  4. GtkCairo.e -- include this when drawing graphics.
  5. GtkSourceView.plugin -- include a full-featured programmer's editor  "widget" in your program, handles 200 languages.
  6. GtkWebKit.plugin -- include a web-browser "widget" in your program, then add your own custom features using Euphoria, if you wish.
  7. several other small support libraries -- pre-built "About" dialogs, for example.
  8. Euphoria syntax color-coding for various popular programming editors.

Plus more than 250 demos, including several simple games, a simple web server, plus extensive html documentation.

Requirements:

libgtk.3.8.0 or better.

Euphoria 4.1 or later. I recommend Euphoria 4.1 Beta 2 from OpenEuphoria.org

Text editor -  any plain text editor will do, but try this useful cross-platform WEE editor written in Euphoria:
https://github.com/peberlein/WEE/

GTK docs - almost mandatory! You won't get far unless you have access to these.

Help for EuGTK is available from the forum at OpenEuphoria.org

  
 
 

Left to right:
    1. Windows native file chooser running on Windows 7
    2. Animation using CSS in GTK (click to see animation)
    3. BEAR (web page browser, html, css, and program editor with syntax highlighting for 100+ languages, edit and test run Euphoria programs. Linux only.)
    4. Raspberry Pi (via vnc) with text editor written in Euphoria/EuGTK. Includes syntax highlighting for 100+ languages, in only 250 lines of code.

Click on the image for a larger view.


Copyright 2017 by Irv Mullins
Comments