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: Kero van Gelder
Subject: Re: [rgui-dev] project design proposal
Date: Sat, 14 Dec 2002 11:06:23 +0100
User-agent: Mutt/1.4i

> 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.
<moved>
> This will create a simple Interface for some App that calculates the
> next eclipse or something.
</moved>
> First he puts the following in a file metaDesign.rb:
> 
> interface = \
>   [toplevel,
>     [menu,
>       ["File", "save", "open", seperator, "exit"],
>       ["Help", "Help", seperator, "About"]

Part of GUI's is to make things understandable for users.
Users do not "Open a File" without semantics, even though history made
them do so. Admitted, i have no better name here (probably because
there is nothing to load for eclipses, only need to know the place on
earth).

Otherwise, this menu looks wonderfully compact.
Are "save", "help" supposed to be functional descriptions? So the menu
knows what to do?

>     ]
>     [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) )],

Why not make a Date? Why restrict to 1900..2050, you want more
millenium problems? Ruby's Date class has no such restrictions, so
that' s solved already.

The implementation of the Date Widget can still use three entries,
though that's not the most convenient way of entering a date.

>       [container, button("Ok"), button("Apply"), button("Cancel")],
>     callback(
>       button("Action"),
>       message(
[snip]
>       )
>     statusbar
>   ]

I suggest button("Action", callback = ...), since your array contains
widget descriptions. Consistency is important.

> 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.

Assuming there is a configfile for the user (or system-wide), since
users are not interested in daily layouting.

> 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
> - ...

just curious, what program is going to use the XML, then?

> 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!"

except for the '$'.



+--- Kero ------------------------------ address@hidden ---+
|  Don't split your mentality without thinking twice       |
|                          Proud like a God -- Guano Apes  |
+--- M38c ---------- http://httpd.chello.nl/k.vangelder ---+



reply via email to

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