Re: Unified libraries to allow porting code to other oses
- Posted by _tom (admin) May 27, 2015
- 2670 views
Here is my thinking about graphical applications.
UI (User Interface) selection guide.
(1) Graphical Software: native, adopted, independent.
Native is "what comes with the operating system."
- For windows: what Microsoft gives you.
- For unix: GTK, QT, Enlightenment.
Advantages: nothing extra has to be installed, native look and feel.
Adopted is "what you add to make native graphics workable."
- For windows it could be wxWidgets, IUP, maybe GTK
- For unix it could be wxWidgets, IUP.
- Unix also allows a GTK system to have QT and others.
Advantages: UI becomes easier to program, can be multiplatform.
Disadvantage: extra software to install.
Independent is "your own graphical software."
- For windows: Java, Redy.
- For unix: Java, (? Redy).
Advantages: can be easy to program, can be multiplatform.
Disadvantages: extra software to install, unique look and feel.
(2) Toolkit: programmer interface to graphical software.
Bare metal or program graphics directly.
Painful...don't do it.
Toolkit is paired with graphical software.
Choice of graphics & toolkit becomes a matter of personal choice.
(3) IDE: UI layout program.
windows
- native: almost mandatory to have IDE
unix
- can program euGTK without IDE, can use Glade if desired
(4) Final considerations: size, complexity, personal choice.
Conclusion
You will never get one "true" UI for any system since there are too many subjective choices.
Tom's Experiment
Rename EWG|tinEWG to eWui (Euphoria Widget User Interface). This allows for eTui (Euphoria Text User Interface) which could be a clean-up of existing I|O routines and documentation.
Here is my windows experiment for creating a UI application.
Pick tinEWG as the toolkit: native graphics (no extra installation), toolkit, IDE, small and managable for a beginner.
The idea is to have a database format for the IDE that can be edited directly and uses a universal syntax (see Jean-Marc unified libraries, see Ryan Redy )
First example from EWG would look like this:
sequence ui = { { "window", "WinHwnd" }, { "title", "eWui -- the First program" }, { "icon", "T.ICO" }, -- children to window follow { { { "Button", "button1" }, { "title", "Info" }, { "click", ` InfoMsg("Programmed in Euphoria with eWui Toolkit","eWui") ` }, {} -- button has no children } } }
Second example from EWG would look like this:
sequence ui = {"""Window = "WinHwnd", Title = "eWui -- Two Buttons", Icon = "EuWinGui.ICO", WindowType = NoSysWin, -- example has two children """, { {"""Button = button1, Title = Close, Position = `10, 10` Click = `if AskMsg("Are you sure you want to quit?","eWui") then exit end if `, """, {} }, {"""Button = button2, Title = About, Position = `145, 10`, Click = `InfoMsg("A simple window with two buttons.\nCreated with eWui","eWui -- about" )` """, {} } } }
Writing a program to convert from the database to a working EWG|tinEWG program was not difficult--it worked. It may be possible to use this information to output a GTK program. I have not yet tried to modify the existing IDE to output in this format.
_tom