Wiki Diff eugtk, revision #40 to tip
{{https://i.imgur.com/jTkbGPtl.png}}
= Overview =
EuGTK is a //complete// and //up-to-date// Euphoria 4.1 wrapper for the [[https://www.gtk.org/|GTK3]] GUI (graphic user interface) for **Linux**,** Windows**, and **OS-X**. Euphoria 4.1b2 is required, earlier versions 3.x and 4.0 do not work.
*All GTK3 widgets are wrapped, and up-to-date with the latest version of GTK3 - currently 3.24.5 on Windows, 3.22.30 on Mint (Aug 1, 2019). GTK is also one of the few GUI packages that is under continuous development and updating.
*Euphoria/GTK code is //much// simpler and easier to understand than similar libraries for other programming languages. There's no need to manually size and position interface objects, and objects can be referred to by 'handle' or by name, whichever makes your code clearer. Dot notation for properties can be used: {{{ set("MainWindow.title","Hello") for example.}}}
*EuGTK uses a pseudo object oriented approach. Objects have properties which you can 'set' or 'get', by property name. Many difficult or complex GTK3 functions (such as creating and using a {{{GtkListView}}}) have easier-to-use alternatives implemented in Euphoria.
= History =
Built on an original concept by **Dave Cuny**, with help from
Pete Eberlein, Greg Haberek, Kenneth Rhodes, Ron Tarrant, C.K. Lester, Don Cahela, Mike Sabal, Jerry Story, Derek Parnell, Jeremy Cowgar, and others. It is currently maintained by **Irv Mullins**.
= Download =
The latest EuGTK version can be downloaded from [[http://sites.google.com/site/euphoriagtk/Home]]\\
Or previous version (fallback in case the latest has bugs!) at [[https://github.com/irvm/EuGTK]]
As of August 2023, and possibly back in May 2023, the above links stopped working.
However, you can still grab the fallback from [[https://github.com/davidbruce/EuGTK]] or [[https://github.com/davidbruce/EuGTK/tree/ce5fbbf47d27d8156c1265a5636d83dbbfa3ad9b]] if you prefer **Irv Mullins** unmodified code.
For a simple download, you can grab it from [[https://github.com/davidbruce/EuGTK/blob/ce5fbbf47d27d8156c1265a5636d83dbbfa3ad9b/EuGTK4.15.0.tar.gz]]
There is also a copy at http://phix.x10.mx/pmwiki/pmwiki.php?n=Main.Eugtk40Library
= Platforms =
EuGTK runs on **Linux**, **Windows**, and **OSX**.
In most cases, the same source code can run on all three platforms without change.
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. Apparently, only 64-bit versions are now being maintained. A link to an easy GTK for Windows installer is included in the pdf which comes with the EuGTK package.
For **OSX**, you must install the **gtk3** package with [[MacPorts|https://www.macports.org/]]
For **Raspberry Pi**
https://openeuphoria.org/wiki/view/RaspberryPi.wc
= Installation =
Simply open the .gz file, drag the 'demos' folder and drop it into your home folder (e.g. /home/irv/*demos goes here*).
Putting the EuGTK files in other locations will require some extra work, and isn't recommended. Demo programs and documentation will not be able to find the needed support files if you do this.
When you write your own programs, you can put things wherever you choose.
= Documentation =
Extensive html docs are provided with the download, as well as more than 250 test programs which you can use to
explore the capabilities of GTK3, and to copy/paste to make your own programming easier.
----
== Simple, easy syntax:
----
**Keywords**
* **create** - declares a new, unique instance of a GTK object (a.k.a. 'widget')
* **add** - puts 'widgets' into container, sharing available space equally
* **pack** - puts 'widgets' into container, using only as much space as required
* **show_all** - instantiates created widget instances
* **set** - set one or more properties of a widget
* **get** - retrieve the value of a widget property
* **main**
** enters the GTK main loop,
** waits for user activity (called 'events')
** and calls your Euphoria function(s) which you have connected to those events
----
== Capable of creating complex programs:
----
//BEAR// (for __B__rowse, __E__dit, __a__nd __R__un), shown above, edits and runs EuGTK programs, and is an excellent and productive web page html/css editor/viewer as well.
The built-in program editor has syntax-color coding for more than 100 programming languages, selectable fonts, and pop-up help for both Euphoria and GTK keywords..
//(Linux only at this time)//
----
== Drag & Drop Design
----
You can create your programs using any plain-text editor ([[https://github.com/peberlein/WEE/|WEE]] is recommended), or you can use [[https://glade.gnome.org|Glade]] to design your user interface visually, then load the interface with just one line of Euphoria code!
----
== Notes
----
Although for most purposes, interpreting or binding EuGTK programs works fine,\\
if you wish to compile your program, on newest Linux distros (e.g. Mint 19) euc fails: \\
You'll need to run a short script, shown below.\\
\\
Replace $1 with the name of program you are compiling:\\
Replace the -j8 with -j[n] where [n] is the number of processors you have. Makes things faster.\\
\\
$ euc -build-dir build -extra-lflags="-no-pie" -makefile $1.ex \\
$ make -j8 -f $1.mak -C build \\
= Overview =
EuGTK is a Euphoria 4.1 wrapper for the GTK 3 GUI user interface.
Euphoria/GTK code is //much// simpler and easier to understand than similar libraries for other programming languages.
= 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**.
= Platform =
EuGTK runs on **Linux**, **Windows**, and **OSX**. The latest version (4.11.7) May 2016, 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.
Latest 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.
These are available from [[http://gtk.org]] on the downloads page.
For **OSX**, you must install the **gtk3** package with [[MacPorts|https://www.macports.org/]]
EuGTK uses an object-oriented approach to coding. Below is a sample:
<eucode>
--------------------------------------------------------------------------------------
-- Requisite Hello World! program uses markup to style label text;
--------------------------------------------------------------------------------------
include GtkEngine.e
constant docs =
"<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"
constant icn = valid_icon_name( -- find a usable icon,
{"face-laugh", -- from the icon theme, if available;
"~/demos/thumbnails/mongoose.png"}) -- or from a file, otherwise
constant win = create(GtkWindow,{ -- the main window
{"border width",10},
{"position",GTK_WIN_POS_CENTER},
{"icon",icn}})
connect(win,"destroy","Quit") -- clean up after ourself!
constant -- here are the window contents; (a.k.a. 'widgets')
panel = create(GtkBox,VERTICAL),
lbl1 = create(GtkLabel),
box = create(GtkButtonBox),
btn = create(GtkButton,"gtk-quit","Quit")
-- add the contents to the window;
set(lbl1,"markup",docs)
add(win,panel)
add(panel,lbl1)
add(box,btn)
pack_end(panel,box)
-- show window and all its contents;
show_all(win)
-- enter the GTK main processing loop;
main()
</eucode>
== Unix:
{{https://sites.google.com/site/euphoriagtk/test.png}}
== Windows:
{{https://sites.google.com/site/euphoriagtk/testw.png}}
== Trouble Shooting ==
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. You must also add a eu.cfg file to your home folder if you want to
start EuGTK programs by clicking an icon in your window manager. When you write your own programs using EuGTK, you can set up paths in whatever manner you prefer.
= Overview =
EuGTK is a //complete// and //up-to-date// Euphoria 4.1 wrapper for the [[https://www.gtk.org/|GTK3]] GUI (graphic user interface) for **Linux**,** Windows**, and **OS-X**. Euphoria 4.1b2 is required, earlier versions 3.x and 4.0 do not work.
*All GTK3 widgets are wrapped, and up-to-date with the latest version of GTK3 - currently 3.24.5 on Windows, 3.22.30 on Mint (Aug 1, 2019). GTK is also one of the few GUI packages that is under continuous development and updating.
*Euphoria/GTK code is //much// simpler and easier to understand than similar libraries for other programming languages. There's no need to manually size and position interface objects, and objects can be referred to by 'handle' or by name, whichever makes your code clearer. Dot notation for properties can be used: {{{ set("MainWindow.title","Hello") for example.}}}
*EuGTK uses a pseudo object oriented approach. Objects have properties which you can 'set' or 'get', by property name. Many difficult or complex GTK3 functions (such as creating and using a {{{GtkListView}}}) have easier-to-use alternatives implemented in Euphoria.
= History =
Built on an original concept by **Dave Cuny**, with help from
Pete Eberlein, Greg Haberek, Kenneth Rhodes, Ron Tarrant, C.K. Lester, Don Cahela, Mike Sabal, Jerry Story, Derek Parnell, Jeremy Cowgar, and others. It is currently maintained by **Irv Mullins**.
= Download =
The latest EuGTK version can be downloaded from [[http://sites.google.com/site/euphoriagtk/Home]]\\
Or previous version (fallback in case the latest has bugs!) at [[https://github.com/irvm/EuGTK]]
As of August 2023, and possibly back in May 2023, the above links stopped working.
However, you can still grab the fallback from [[https://github.com/davidbruce/EuGTK]] or [[https://github.com/davidbruce/EuGTK/tree/ce5fbbf47d27d8156c1265a5636d83dbbfa3ad9b]] if you prefer **Irv Mullins** unmodified code.
For a simple download, you can grab it from [[https://github.com/davidbruce/EuGTK/blob/ce5fbbf47d27d8156c1265a5636d83dbbfa3ad9b/EuGTK4.15.0.tar.gz]]
There is also a copy at http://phix.x10.mx/pmwiki/pmwiki.php?n=Main.Eugtk40Library
= Platforms =
EuGTK runs on **Linux**, **Windows**, and **OSX**.
In most cases, the same source code can run on all three platforms without change.
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. Apparently, only 64-bit versions are now being maintained. A link to an easy GTK for Windows installer is included in the pdf which comes with the EuGTK package.
For **OSX**, you must install the **gtk3** package with [[MacPorts|https://www.macports.org/]]
For **Raspberry Pi**
https://openeuphoria.org/wiki/view/RaspberryPi.wc
= Installation =
Simply open the .gz file, drag the 'demos' folder and drop it into your home folder (e.g. /home/irv/*demos goes here*).
Putting the EuGTK files in other locations will require some extra work, and isn't recommended. Demo programs and documentation will not be able to find the needed support files if you do this.
When you write your own programs, you can put things wherever you choose.
= Documentation =
Extensive html docs are provided with the download, as well as more than 250 test programs which you can use to
explore the capabilities of GTK3, and to copy/paste to make your own programming easier.
----
== Simple, easy syntax:
----
**Keywords**
* **create** - declares a new, unique instance of a GTK object (a.k.a. 'widget')
* **add** - puts 'widgets' into container, sharing available space equally
* **pack** - puts 'widgets' into container, using only as much space as required
* **show_all** - instantiates created widget instances
* **set** - set one or more properties of a widget
* **get** - retrieve the value of a widget property
* **main**
** enters the GTK main loop,
** waits for user activity (called 'events')
** and calls your Euphoria function(s) which you have connected to those events
----
== Capable of creating complex programs:
----
//BEAR// (for __B__rowse, __E__dit, __a__nd __R__un), shown above, edits and runs EuGTK programs, and is an excellent and productive web page html/css editor/viewer as well.
The built-in program editor has syntax-color coding for more than 100 programming languages, selectable fonts, and pop-up help for both Euphoria and GTK keywords..
//(Linux only at this time)//
----
== Drag & Drop Design
----
You can create your programs using any plain-text editor ([[https://github.com/peberlein/WEE/|WEE]] is recommended), or you can use [[https://glade.gnome.org|Glade]] to design your user interface visually, then load the interface with just one line of Euphoria code!
----
== Notes
----
Although for most purposes, interpreting or binding EuGTK programs works fine,\\
if you wish to compile your program, on newest Linux distros (e.g. Mint 19) euc fails: \\
You'll need to run a short script, shown below.\\
\\
Replace $1 with the name of program you are compiling:\\
Replace the -j8 with -j[n] where [n] is the number of processors you have. Makes things faster.\\
\\
$ euc -build-dir build -extra-lflags="-no-pie" -makefile $1.ex \\
$ make -j8 -f $1.mak -C build \\