Re: Zsh + GUI
adrian_at_satisoft.com
Date: 07/07/05
- Next message: John DuBois: "Re: how to: remove last line from file 1 and append t0 file 2"
- Previous message: Jimbo: "Current script name using $0"
- In reply to: Chris F.A. Johnson: "Re: Zsh + GUI"
- Next in thread: bsh: "Re: Zsh + GUI (was: (patch for Bash) Here-file)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Jul 2005 09:10:21 -0700
>
> No widget interface is going to be that simple.
>
Well no - but there are good reasons.
While something like...
print_buttons "buton1" "button2"
...may create a couple of buttons, most people have a requirement to
define where in the window the buttons appear and maybe other things
like; the size of the buttons, whether they have a border, the spacing
between the buttons, whether a particular button is active or not - and
so forth.
Using SATSHELL (which I appreciate doesn't meet your needs, but to use
it as an example) it is possible to do something like...
addButtons (1,2 6 {Button_1 b1} {Button_2 b2} {Exit exit}}
...which will create three buttons with text "Button 1", "Button 2" and
"Exit". Each button has a width of 6 units with the left of the first
button positioned in line 2 position 1. "Button 1" will call a shell
function called "b1" when pressed, "Button 2" will call "b2" and the
"Exit button" will exit the script.
This is not really any more complex than your example - no case (or
other conditional) statement is required as the functions are called
directly.
Developing simple ways to create basic dialog boxes and such like is
not difficult - but if you want to have the flexibility that many
people require from a GUI (things like buttons, entry fields, text
borders, check buttons, radio buttons, toolbars, menus,dropdown lists,
text, tables etc - and the ability to put them where you want!!), then
the programming will need to be a little more complex. Just look at a
few GUI windows and think how you might define it using the least
complex method you can think of - It's not as simple as it first
appears.
SATSHELL uses a coordinate system to position screen items - there are
other ways. I've also developed a Tcl/Tk screen layout system (GRIDPLUS
- http://www.satisoft.com/tcltk/gridplus) which defines the window
layout as a hierarchy of grids. The items and grids are positioned
relative to each other, not at specific coordinates. I find this method
quicker as it is not neccessary to define exactly where the items will
be. Again, this is not what you are after but does give an example of
an alternative method to define the layout of a GUI.
Best Regards,
=Adrian=
- Next message: John DuBois: "Re: how to: remove last line from file 1 and append t0 file 2"
- Previous message: Jimbo: "Current script name using $0"
- In reply to: Chris F.A. Johnson: "Re: Zsh + GUI"
- Next in thread: bsh: "Re: Zsh + GUI (was: (patch for Bash) Here-file)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]