Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jun 2002 10:00:48 -0400
From:      Antoine Beaupre <anarcat@anarcat.ath.cx>
To:        Max Okumoto <okumoto@ucsd.edu>
Cc:        freebsd-libh@FreeBSD.ORG
Subject:   Re: Hui API doc
Message-ID:  <CDC0C844-7955-11D6-8A4B-0050E4A0BB3F@anarcat.ath.cx>
In-Reply-To: <hf660x8azu.fsf@multivac.sdsc.edu>

index | next in thread | previous in thread | raw e-mail

Le mercredi 5 juin 2002, à 09:13 PM, Max Okumoto a écrit :

> I felt left out looking at all the new documentation so I have written
> up a little documentation for the parts that I am working on recently.

I thought that would happen. Very good work! It's a good idea to start 
"real" (as in "not doxygen") documentation on the Hui. Since you now 
have access to the WWW repo, you could also make your own timetable and 
let the world know where you're at with the Hui cleanup. I'm curious. ;)

Please don't feel left out. Your work is as important as any other in 
the project, and presently, you're the most active committer. :)

> But I don't know where it would fit in...
> Can someone look it over and tell me where it put it?

I don't think it belongs to the sysinstall2.sgml file, since it should 
really be called "packageNG.sgml".

It would, however, fit pretty well in the doc/hui.sgml document that 
only contains a introduction, right now.

You can commit straight to this file if you want. It's seriously 
outdated and you could probably give it a good refresh. If you can't 
deal with SGML, I could commit small bits to the file.

We could modify the web update script to build and install this file 
too, though I haven't setup DocBook builds on usw4 yet.

A few comments on the document itself:

> Hui Programming API
>
>         Intro
>         -------
>         The graphical user interface for libh is the Hui subsystem.

Don't say "graphical" since it can be text-based. :) Just "The user 
interface" is fine.

>         Currently there are two graphics implementations, text based
>         (Turbo Vision) and X window (Qt).  The scripting language
>         is tcl.

I think the wording "front-end" and "back-end" would be more appropriate.

So I'd put the whole paragraph as:

Intro

The front-end User Interface (UI) for libh is the Hui subsystem. There 
are currently two back-ends implemented: text-based (Turbo Vision) and 
graphics-based (X Window System/Qt). The scripting language is TCL.

>         Programming Model
>         -------
>         The programming model is a container and element system.
>         Graphical elements and other containers are created by their
>         parent containers.  The resulting hierarchy is a tree like
>         structure with containers as internal nodes and elements
>         as leaves.
>
>         The root of the tree is the Hui object.  From this object
>         you can create a menu bar, windows and dialogs.

A graphic would be nice here. :)

>         The two containers, windows and dialogs, have many of the
>         same features but dialogs can return result strings, and
>         are modal.  In windows and dialogs you can create the
>         following objects:
>                 o button
>                 o input line
>                 o label
>                 o list box
>                 o progress indicator
>                 o text edit
>
>         [I have to examine the code more for this section.]
>         But it looks like there can only be one menu bar.  This bar
>         is associated with the first window created which requests
>         a menu bar.

Indeed, There Can Be Only One menubar. Look also at the bug in the BUGS 
file regarding that.

I think this is due to a limitation in TVision, but we could possibly 
work around this limitation by changing the menu bar depending on which 
window has the focus in TVision. That's probably too much trouble for 
nothing.

Note that Qt dialogs (ours, at least) don't have menu bars and have 
fixed sizes, in opposition with Qt windows.

>         Element Placement.
>         -------
>         The placement of elements and containers are absolute
>         coordinates relieve to their container. [There is no automatic
>         placement in the containers as far as I can tell]

I guess this should have read:

"The placement of elements and containers are in absolute coordinates 
relative to their container."

That is true, but there *is* also automatic placement in Hui. For an 
example, look at the diskeditor, in particular, a trivial example is in 
the test stub, release/scripts/disk.tcl:

set test_window [$hui window "labeltest"\
                     "Partition Editor Test Loader" "1 0" "40 5" 
"horizontal"]

$test_window button "disk" "&Test diskeditor" {disk_callback ""} 
"default"
$test_window button "newfs" "&Test newfs" {newfs_callback ""} "default"
$test_window button "quit" "&Quit" {quit_callback ""}

$test_window show
$hui run

The buttons are disposed properly as seen on the top left window 
("Partition Editor Test Loader") of the screenshot:

http://usw4.freebsd.org/~libh/screenshots/screenshot-hui-
console+qt-2002-05-29.jpg

Good work!

A.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-libh" in the body of the message



help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CDC0C844-7955-11D6-8A4B-0050E4A0BB3F>