gutopia-dev
[Top][All Lists]
Advanced

[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 01:40:29 -0700
User-agent: KMail/1.4.3

Thorsten, please bare with me here. i need to learn to walk on this before i 
can run. so let me purpose that we identify the extremities of this example, 
then work out the Interface Definition that lies inbetween. the formula is 
essentially:

  metaDesign.X(Model, InterfaceDefinition) --> X

first, here's a skeleton of the Model:
(by the way, i was a bit confused by OK, Apply, Cancel  vs. Action)

class EclipseCalculator
        def initialize
         end
        def action(year,month,day)
                # this would calculate then next eclipse and return the date
         end
        def save
         end
        def open
         end
        def exit
         end
        def help
         end
        def about
         end
        def statusbar
         end
end

we can all pretty much imagine what metaDesign.GUI() will produce. i.e. a 
script defining a window with a menu bar, some buttons, etc.

can you give me a rough example of a CORBA result? b/c i have no idea what 
that would be. and examples of the other possibilities as well would help 
too.

thanks,
-transami


On Friday 13 December 2002 06:38 pm, Thorsten Roggendorf wrote:
> Hi,
>
> I have a first draft of how to design the API. I'll show you the steps
> required of the client programmer in defining his interface.
> First he puts the following in a file metaDesign.rb:
>
> interface = \
>   [toplevel,
>     [menu,
>       ["File", "save", "open", seperator, "exit"],
>       ["Help", "Help", seperator, "About"]
>     ]
>     [container,
>       [container,
>         entry("Day",   integer(Time.now.day,     1..31  ) ),
>         entry("Month", integer(Time.now.mon,     1..12  ) ),
>         entry("Year",  integer(Time.now.year, 1900..2050) )],
>       [container, button("Ok"), button("Apply"), button("Cancel")],
>     callback(
>       button("Action"),
>       message(
>         "Next eclipse ist at ",
>         string(???),
>         "day the ",
>         integer(1..31),
>         ". of ",
>         integer(1..12),
>         " ",
>         integer,
>         "."
>       )
>     statusbar
>   ]
>
> This will create a simple Interface for some App that calculates the
> next eclipse or something.
> The whole thing is a nested ruby Array. Every element that not itself an
> Array or a String is a function call.
> The first element of each nested Array is the container of further
> nested elements. If the container is specified layout is up to the user,
> otherwise the backend tries to make good choices.
> A simple script can be run over this file and will replace the ??? with
> a complete and informatively named argument list.
> Another script call generates a couple things:
> - metaDesign.gui.rb: the GUI-Code in GUItopia API
> - metaDesign.xml: XML definition of possible parameter files
> - metaDesign.COR: CORBA interface definition
> - metaDesign.callback.rb: callback skeletons for the buttons and menus
> - ...
>
> metaDesign.callback.rb will start with "require 'metaDesign.gui.rb'".
> The "Action" button will automatically display a message window. In
> CORBA interfaces the constant strings will be removed from the return
> message and an array of ints returned. In parameter file execution the
> message will be printed to standard out.
> Integer entries will automatically be labled spinbuttons and so on.
> In metaDesign.callback.rb you can do things like:
> $toplevel.container.container1.hide
> $toplevel.container.container2.deactivate
> $toplevel.button.deactivate
> $topleve.statusbar = \
>   "I don't want to calculate eclipses anymore, get me another job!"
>
> Cheers
>
>    Thorsten
>
>
>
> _______________________________________________
> Gutopia-dev mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/gutopia-dev




reply via email to

[Prev in Thread] Current Thread [Next in Thread]