I want to follow up here on an idea from the "Java version?" thread, not really about Java but rather the problem of cross-platform GUI development.
Suppose that the Celestia core (i.e. excluding the GUI) were encapsulated in a command language interface. In other words, the Celestia core functionality would be controlled completely using command strings. Thus for example, in the GUI (on any platform), pressing the 'L' key (to make time go faster) would simply send the string "time.rate *= 10.0" (or something like that) to the Celestia command language interpreter. All other Celestia functions would be controlled in a similar way.
Once this were in place, it would be possible to design the GUI (on each platform) to load its key definitions from a file. The key definition format might be something like "keydef L : time.rate *= 10.0". Such key definition files could be essentially platform-independent. New key commands could easily be added without any recoding of the GUI. Also, users could use the same mechanism to customize key definitions to their personal tastes.
Such a scheme could also be used to provide cross-platform menu definition files. The definition file would specify the label string for the menu item and the command string to be sent to the Celestia command interpreter when the item was selected. The GUI would read the definition file and build the menus and send the commands as specified therein. Again, new menu commands could be added without modifying the GUI, and users could customize their menus as they choose.
It is conceivable that a similar command-based cross-platform definition file approach could be used for browsers and other GUI features as well.
The command specification would not be limited to single commands, but could include elaborate command sequences (including conditionals, etc.) These could also be used as script files, of course, invoked by filename. In addition, scripts could be created via live recording simply by capturing the command strings as they are received by the command interpreter.
And since the command interpreter simply receives a command string as input and returns a result string as output, it could easily be integrated in almost any GUI environment.
Just a thought.
- Hank
Celestia Control
-
- Posts: 986
- Joined: 16.08.2002
- With us: 22 years 3 months
- Location: USA, East Coast
-
Topic authorHankR
-
- Posts: 986
- Joined: 16.08.2002
- With us: 22 years 3 months
- Location: USA, East Coast