update platform 5

Documentation Version for Comments and Changes

You are invited to make any changes...add any comments.

Changes will `eventually` be merged into the offical documentation.

Leave any commnents here...


... back to index page OE documentation

Euphoria: wxEuphoria. It is cross-platform.

You can download WxEuphoria, Win32Lib and Judith's IDE from the Euphoria Web site.

Low-Level WINDOWS Programming

To allow access to Windows at a lower level, Euphoria provides a mechanism for calling any C function in any Windows API .dll file, or indeed in any 32-bit Windows .dll file that you create or someone else creates. There is also a call-back mechanism that lets Windows call your Euphoria routines. Call-backs are necessary when you create a graphical user interface.

To make full use of the Windows platform, you need documentation on 32-bit Windows programming, in particular the Windows Application Program Interface (API), including the C structures defined by the API. There is a large WINDOWS.HLP file (c) Microsoft that is available with many programming tools for Windows. There are numerous books available on the subject of Windows programming for C/C++. You can adapt most of what you find in those books to the world of Euphoria programming for Windows. A good book is Programming Windows by Charles Petzold.

A Windows API Windows help file (8 Mb) can be downloaded from ftp://ftp.borland.com/pub/delphi/techpubs/delphi2/win32.zip, Borland's Web site.

The Unix Platforms

As with Windows, you can write text on a console, or xterm window, in multiple colors and at any line or column position.

Just as in Windows, you can call C routines in shared libraries and C code can call back to your Euphoria routines.

You can get a Euphoria interface to high level graphics library OpenGL from the Euphoria Web site. OpenGL also works with Windows.

Easy X-windows GUI programming is available using either Irv Mullin's EuGTK interface to the GTK GUI library, or wxEuphoria developed by Matt Lewis. wxEuphoria also runs on Windows.

When porting code from Windows to Unix, you'll notice the following differences:

  • Some of the numbers assigned to the 16 main colors in graphics.e are different. If you use the constants defined in graphics.e you won't have a problem. If you hard-code your color numbers you will see that blue and red have been switched etc.
  • The key codes for special keys such as Home, End, arrow keys are different, and there are some additional differences when you run under XTERM.
  • The Enter key is code 10 (line-feed) on Linux, where on Windows it was 13 (carriage-return).
  • Other OSes use '/' (slash) on file paths. Windows use '\' (backslash). If you use the SLASH constant from std/filesys.e you don't have to worry about this however.
  • Calls to system and system_exec that contain Windows commands will obviously have to be changed to the corresponding Linux or FreeBSD command. e.g. "DEL" becomes "rm", and "MOVE" becomes "mv". Often you can use a standard library call instead and it will be portable across platforms. For example you can use filesys:create_directory or filesys:delete_file.

When running an interpreter or translator for a Unix platform, platform will return one of the several symbols for UNIX and a parsetime branch (with ifdef/end ifdef) with UNIX and the symbol that is that of the specific OS

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu