Slashdot Mirror


Developing Attractive non-GUI Apps for Unix?

Lysol asks: "Many years ago I wrote a POS (Point of Sale System) in a language (that's amazingly still around) called PowerBasic. One thing I really liked about it was the ability to do inline assembly and compile to machine code, which was a very big deal for DOS-based Basic code. For my POS app I used many text graphic libraries that gave me a poor-mans GUI for DOS. Now I'm going back to school and I need to brush up on my C, and that got me thinking about developing it in Linux. When I deployed this system it ran on old 386 machines. A lot of newer systems run on expensive hardware and it would be cool to provide a free GPL POS on Linux that can function as aterminal/text based solution. If you've ever used a cash register, sometimes GUI stuff with a mouse is not the best...especially for end users." One only has to look at FreshMeat to find examples of text UI libraries (and I'm sure that list isn't a complete one), but which ones have you used that you found enjoyable to develop in? How easy would it be to develop a text-mode application that has a UI that is just as capable as any GUI?

"I first want to deploy it using a terminal interface instead of a GUI interface for the simple reason that there will be times when it's better to run thin machines without installing X11, and it might be easier to implement rather than jumping right into GTK or some X11 widget toolkit. So does anyone know of any character based UI libraries that are available for C?"

8 of 150 comments (clear)

  1. Python text interface libraries by cduffy · · Score: 4
    If Python's your game (and it should be!) you can find some Python textual UI libraries at:
    http://www.vex.net/parnassus/apyllo.py/808292924.2 43256747 (remove the space, slashdot put it in).

    Yes, I know, you're a C programmer... but (a) this might be useful to someone, and (b) you should really consider using python, at least for your prototype -- it's much, much faster to develop with.

  2. Re:wussies by double_h · · Score: 5

    You sissies and your monitors...why don't you program like real men, using flashing LEDs to let you know what's going on.

    Ahh, you too have no idea how coddled and pampered you really are. When I learned to code, LEDs weren't yet in widespread use, and all of the computers used HEDs (heat emitting diodes) for status displays. The only way to tell if a bit was set was to touch a HED and see if your fingers got burned. It was no fun at all coming off of an all-night hacking binge with my fingers covered in tiny pinpoint-sized burns from a particularly gruelling debugging session, only to go to work for twelve hours manufacturing watch springs in a dangerous sweatshop just so I could afford the computer time and a bit of coal to fuel young Timmy's iron lung.

    I'm just glad I wasn't there the night that some fool decided to mess around with the system clock multiplier, causing all the HEDs to set fire to the console, burning down not only the data center but also two adjacent nursing homes and a Salvation Army warehouse used to store surplus 72oz cans of bean w/bacon soup.

    Reservoir Zigs

  3. Linux POS System by SirShadowlord · · Score: 5

    Ah, none other than the Jamie Zawinski (of netscape/Mozilla/Lucid Emacs fame) has been working on this particular problem.

    Check out:
    http://www.dnalounge.com/backstage/log/2001/02.htm l

    Where Jamie provides a pointer to:

    http://www.linuxcanada.com/linuxpos.html

    He also took a swipe at hacking up his own Linux based POS system:

    http://www.dnalounge.com/backstage/src/pos/

    --
    - Any Day above Ground is a good Day (Michael Rich, 1997)
  4. PicoGUI with ncurses by micahjd · · Score: 4
    I wrote this ncurses driver more as a joke, but maybe it would be useful for someone...

    PicoGUI is a GUI for embedded systems I've been working on for a while. It's video library is pretty flexible, so much so that it can render to ncurses! This means that PicoGUI apps can run in text mode almost the same as they would run in a graphical mode. The advantages would be a capable GUI that's in active development, and an easy upgrade path to a graphical system. Oh, and it's client-server if that helps. PicoGUI has client libraries for C and Perl, and more languages will be coming.

    Some disadvantages though... Currently the keyboard tabbing isn't fully functional, and mouse input probably isn't applicable here, so you might have to do some funky coding to move the focus from field to field, etc. Also, it's a relatively new GUI so it might be missing features here and there.

    --
    -- 2 + 2 = 5, for very large values of 2
  5. Curses by Master+Bait · · Score: 4
    Just use curses. It is about the simplest lib out there. You really don't need a DOS workalike api. Really, it will take you about a day to get the hang of it.


    blessings,

    --
    "Only in their dreams can men truly be free 'twas always thus, and always thus will be."
    --Tom Schulman
  6. POS? by Ronin+X · · Score: 4
    Many years ago I wrote a POS (Point of Sale System)

    OH!!! I all this time I thought people were calling me up trying to sell me a Piece Of Shit!

    --
    Ok my karma is maxed out. When do I become Enlightened?
  7. Ncurses Programming by KidSock · · Score: 5

    How easy would it be to develop a text-mode application that has a UI that is just as capable as any GUI?

    Quite easy actually. I've been doing a lot of ncurses programming lately. You can do some amazinly elaborate things with it if your a good programmer. A good technique really pays. If you start running into situations where you're brute-forcing it, I advise that you back off and do a little work on a good "framework" for your app(that's one minus about ncurses, there's very little "flamework").

    Some key points about ncurses:

    o It's very fast - Text mode applications are great for productivity. Their GUI counterparts always turn out to be slower for some reason.
    o Menus and Forms - The menu and form libraries are standard on UNIXes. You can fairly easily create fields for data entry that have built in validation routines ...etc.
    o Tables - Well, not exactly, but a clever way to make a very snappy table is to just use a menu. In text mode you can't tell the differnce. Ncurses menu-tables are more than what the Java 1.1 AWT library provides
    o Well established - Curses programming has been around for a long time. The characteristics of many terminal types has been worked out(by ESR) and abstracted into the terminfo database. Its quite portable.
    o Works Anywhere - You can run it over telnet, ssh, or just dump bulky X alltogether and run on the Linux console.

    Here's some links:

    Ncurses Intro by Eric S. Raymond and Zeyd M. Ben-Halim
    Linux Journal Artical by ESR
    Fujitsu ETI Programmers Guide
    SCO ETI Programming

    I really wish people would concentrate more ncurses programs. They're just damn efficient. Anyone who uses mutt and slrn and such knows what I'm talking about. If you're really clever, you'll librarify whatever it is that your working on so you can hook on a GUI version later after you've tweeked the behavior of the app without wasting a lot of clock-cycles on graphics programming.

  8. Have you considered SLang? by Floody · · Score: 4

    I've used S-Lang considerably in the past on projects which needed a TUI. It was intuitive and had a very slight learning curve.

    Check out http://www.s-lang.org/