Historical eugtk, Revision 62
Overview
EuGTK is a Euphoria 4.1 wrapper for the GTK3 GUI user interface.
Euphoria/GTK code is much simpler and easier to understand than similar libraries for other programming languages.
All GTK 3 "widgets" are implemented and tests for each are provided. EuGTK uses an "object oriented" approach, and many difficult or complex GTK3 calls have easier-to-use Euphoria 'overlays'.
History
Built on an original concept by Dave Cuny, with help from Mike Sabal, Ron Tarrant, and others. It is currently maintained by Irv Mullins.
Platforms
EuGTK runs on Linux, Windows, and OSX. The latest version (4.12.2) Feb 2017, makes it very easy to build complex GUI interfaces for your programs. Interface can be hand-coded or designed using Glade. In many cases, the same source code can run on all three platforms without change.
The latest EuGTK version can be downloaded from http://sites.google.com/site/euphoriagtk/Home
On the Linux platform, EuGTK uses the GTK3 libraries which are installed by default with current Linux distros such as Mint or Ubuntu, etc...
EuGTK on Windows requires the appropriate GTK libraries for Windows, either 32-bit or 64-bit. Links to several versions are included in the pdf which comes with the EuGTK package.
Note: Although it does work, and is cross-platform without changing code, I don't consider running GTK on Windows to be really practical. If you want to write cross-platform programs that your users will be happy to use, look at the Wee editor for an example of how this can be done.
For OSX, you must install the gtk3 package with MacPorts
Raspberry Pi 3 installation instructions are found at the bottom of this page.
Hello World in EuGTK:
---------------------------------------------------------------------------- --# Yet Another Hello World! program ---------------------------------------------------------------------------- include GtkEngine.e constant -- step [1] create the widgets; win = create(GtkWindow,"border width=10,icon=face-laugh,$destroy=Quit"), pan = create(GtkBox,"orientation=1"), lbl = create(GtkLabel,"color=blue"), box = create(GtkButtonBox), -- default is horizontal; btn = create(GtkButton,"gtk-quit", "Quit") -- step [2] style label text; set(lbl,"markup", "<b><u><span color='red'>Hello World!</span></u></b>\n\n" & "This demos a simple window with\na label and a quit button.\n") -- step [3] add the widgets to containers; add(win,pan) add(pan,lbl) pack_end(pan,box) add(box,btn) -- step [4] display widgets and enter main event processing loop; show_all(win) main()
Unix:
Windows:
Raspberry Pi 3:
Installing on Raspbian:
Follow the links on the Downloads page to download:
- Arm binary for manual installation
- Wee
- EuGTK
Download the latest EuGTK, and click on the EuGTK4.x.x.tar.gz file, read the important note, then drag the demos folder into your home folder.
Download euphoria-4.1.0-ARMv6-hardfloat-5.tar.gz Click on it, and extract to, let's say, your home folder.
Go to your home folder, and open a terminal to copy some files:
cd ~/euphoria-4.1.0-ARMv6-hardfloat/bin sudo cp * /usr/bin cd .. sudo mkdir /usr/share/euphoria sudo chmod 777 /usr/share/euphoria sudo rm /usr/bin/eu.cfg cp -r * /usr/share/euphoriaConfirm that eui is installed:
pi@raspberrypi:~ $ eui Euphoria Interpreter v4.1.0 development 32-bit Linux, Using System Memory Revision Date: 2015-02-02 14:18:53, Id: 5861:57179171dbed ERROR: Must specify the file to be interpreted on the command line(So far, so good!)
Replace /usr/bin/eu.cfg with the following: (will probably have to use sudo nano here)
[all] -eudir /usr/share/euphoria -i /usr/share/euphoria/include [translate] -arch ARM -gcc -con -com /usr/share/euphoria -lib-pic /usr/share/euphoria/bin/euso.a -lib /usr/share/euphoria/bin/eu.a [bind] -eub /usr/share/euphoria/bin/eub
Check that it works
cd /demos
eui test0
Should take a few seconds, and then show the window.
Install WEE
Download WEE-master.zip Use archiver to extract to /home/pi (or /home/your_user_name)
Associate .ex files
cd ~/demos right-click on test0.ex select Properties from the popup window Select Open With -> Customize Click on Custom Command Line enter eui as Command line to execute: Enter Euphoria as the Application name click OK
Double click on an .ex program to see if it works.
Trouble Shooting
If you get a long warning re: accessibility, add the setenv line to GtkEngine.e as shown below:
export constant version = "4.12.2", release = "Feb 1, 2017", copyright = " © 2017 by Irv Mullins" setenv("NO_AT_BRIDGE","1") -- add this line here
Notes
Over on Linux/Mint and probably other Debian distributions, we see libgtk-3.0 is no longer installed to /usr/lib. This causes problems with the library. Until this is worked around you can modify the code so it finds the library, or you can put a symbolic link:
ln -s /usr/lib/*/libgtk-3.so.0 /usr/lib
On Linux/32-bit, the latest eubins fail to work with this library. This is an interpreter problem and not a problem with the library itself. See ticket #933.
If the demos fail with cannot find test1.ex or something, it is because when the documentation says install to the home directory it really means you must install it there.
- diff to current revision, view current revision history, backlinks
- Last modified Jul 08, 2017 by irv