[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rgui-dev] project design proposal
From: |
Tom Sawyer |
Subject: |
Re: [rgui-dev] project design proposal |
Date: |
Sat, 14 Dec 2002 05:04:46 -0700 |
User-agent: |
KMail/1.4.3 |
okay, here's what i divised. i used Yaml for the file format of the interface.
note that
toplevel:
is really just a shorthand for
container:
type: toplevel
the most interesting part is probably the event: clauses which define a change
of attribute based on an action occuring. order: means whether to do that
event before or after (pre and post) the action's callback executes. the
value of the statusbar starts out empty and is only filled with a message
when Ok is activated. i am assuming from your example that the statusbar is
to hold the resulting message.
this is a very high level of abstraction, although it still is a bit GUI
centric. in doing this i imagine we will need to go after the GCF (greatest
common factor) rather than the LCM (least common multiple) between possible
interfaces. and like you said, the GUI is probably, for the most part, that
GCF. we shall see just how far we can manage to abstract away from the
various interfaces, including the GUI.
don't be taken aback by the length of this. Yaml does have shortcuts for
shorting things onto one-liners, but that's not important. the important
thing is clearity and explicitness.
now that i think about it, we could probably have other shorthands for
container:
type: x
and just use
x:
-transami
#
# Meta-Interface Definition for EclipseCalculator
#
model: eclipse
toplevel:
name: eclipseform
container:
name: menu
type: menu
container:
name: filemenu
type: menu
label: File
action:
name: save
label: Save
callback: eclipse.save
action:
name: open
label: Open
callback: eclipse.open
action:
name: exit
label: Exit
callback: eclipse.exit
container:
name: helpmenu
type: menu
label: Help
action:
name: help
label: Help
callback: eclipse.help
action:
name: about
label: About
callback: eclipse.about
container:
name: entryframe
type: frame
entry:
name: day
label: Day
value: #{Time.now.day}
entry:
name: month
label: Month
value: #{Time.now.mon}
entry:
name: year
label: Year
value: #{Time.now.year}
container:
name: action
type: buttonbar
action:
name: ok
label: Ok
callback: eclipse.action
action:
name: cancel
label: Cancel
callback: eclipse.exit
container:
name: message
type: statusbar
value: ''
event:
on: eclipseform.action.ok
order: pre
value: Calculating...
event:
on: eclipseform.action.ok
order: post
value: >
Next eclipse is at day the
#{eclipse.day}
of #{eclipse.mon},
#{eclipse.year}.