Any examples/documentation for python-newt

Discussion in 'Python' started by Harishankar, Mar 27, 2010.

  1. Harishankar

    Harishankar Guest

    I am writing a fairly featureful TUI in python and I figured newt is the
    best lightweight TUI which actually offers widgets. curses is low level
    and its text editing capabilities are poor while UIs like urwid and stfl
    too complex for simple programs like the ones I am creating.

    Could anybody point me to at least a decent example program in newt/snack
    and I don't mean popcorn.py or peanuts.py. Something that at least shows
    how to create a basic menu-driven program in the command line with a main
    menu and implementing several sub menus. Also a bit of explanation of the
    behaviour of OK and Cancel buttons in standard forms would be of help.

    So anybody uses newt? Or have people stopped using text based UIs
    completely?

    --
    -- Harishankar (http://harishankar.org http://literaryforums.org)



    --
    -- Harishankar (http://harishankar.org http://literaryforums.org)
    Harishankar, Mar 27, 2010
    #1
    1. Advertising

  2. On 2010-03-27, Harishankar <> wrote:
    > I am writing a fairly featureful TUI in python and I figured newt is the
    > best lightweight TUI which actually offers widgets. curses is low level
    > and its text editing capabilities are poor while UIs like urwid and stfl
    > too complex for simple programs like the ones I am creating.
    >
    > Could anybody point me to at least a decent example program in newt/snack
    > and I don't mean popcorn.py or peanuts.py. Something that at least shows
    > how to create a basic menu-driven program in the command line with a main
    > menu and implementing several sub menus. Also a bit of explanation of the
    > behaviour of OK and Cancel buttons in standard forms would be of help.
    >
    > So anybody uses newt? Or have people stopped using text based UIs
    > completely?


    I've used it for some trivial stuff, but not for anything very
    sophisticated. Redhat's text-mode installer program (anaconda) was
    written in Python using Newt (I believe it is why Newt was invented).
    That's probably the most "full featured" example I know of.

    --
    Grant
    Grant Edwards, Mar 27, 2010
    #2
    1. Advertising

  3. Harishankar

    Harishankar Guest

    On Sat, 27 Mar 2010 14:44:23 +0000, Grant Edwards wrote:

    > On 2010-03-27, Harishankar <> wrote:
    >> I am writing a fairly featureful TUI in python and I figured newt is
    >> the best lightweight TUI which actually offers widgets. curses is low
    >> level and its text editing capabilities are poor while UIs like urwid
    >> and stfl too complex for simple programs like the ones I am creating.
    >>
    >> Could anybody point me to at least a decent example program in
    >> newt/snack and I don't mean popcorn.py or peanuts.py. Something that at
    >> least shows how to create a basic menu-driven program in the command
    >> line with a main menu and implementing several sub menus. Also a bit of
    >> explanation of the behaviour of OK and Cancel buttons in standard forms
    >> would be of help.
    >>
    >> So anybody uses newt? Or have people stopped using text based UIs
    >> completely?

    >
    > I've used it for some trivial stuff, but not for anything very
    > sophisticated. Redhat's text-mode installer program (anaconda) was
    > written in Python using Newt (I believe it is why Newt was invented).
    > That's probably the most "full featured" example I know of.


    Does your code use forms in an application loop? I am having a bit of
    trouble with getting the form to stack up properly when I displaying
    another. As far as I know the two examples uses a single instance of a
    form which is discarded immediately on exit.

    If you have even a small code sample I wouldn't mind reading it!

    --
    -- Harishankar (http://harishankar.org http://literaryforums.org)
    Harishankar, Mar 27, 2010
    #3
  4. On 2010-03-27, Harishankar <> wrote:

    >> I've used it for some trivial stuff, but not for anything very
    >> sophisticated. Redhat's text-mode installer program (anaconda) was
    >> written in Python using Newt (I believe it is why Newt was invented).
    >> That's probably the most "full featured" example I know of.

    >
    > Does your code use forms in an application loop?


    Not really. It uses a series of forms. I don't think I ever stack
    forms.

    > I am having a bit of trouble with getting the form to stack up
    > properly when I displaying another. As far as I know the two examples
    > uses a single instance of a form which is discarded immediately on
    > exit.


    That's pretty much all my program did.

    > If you have even a small code sample I wouldn't mind reading it!


    I'm afraid I'm not at liberty to post it.

    --
    Grant
    Grant Edwards, Mar 27, 2010
    #4
  5. Harishankar

    Harishankar Guest

    On Sat, 27 Mar 2010 14:56:30 +0000, Grant Edwards wrote:

    > On 2010-03-27, Harishankar <> wrote:
    >
    >>> I've used it for some trivial stuff, but not for anything very
    >>> sophisticated. Redhat's text-mode installer program (anaconda) was
    >>> written in Python using Newt (I believe it is why Newt was invented).
    >>> That's probably the most "full featured" example I know of.

    >>
    >> Does your code use forms in an application loop?

    >
    > Not really. It uses a series of forms. I don't think I ever stack
    > forms.
    >
    >> I am having a bit of trouble with getting the form to stack up properly
    >> when I displaying another. As far as I know the two examples uses a
    >> single instance of a form which is discarded immediately on exit.

    >
    > That's pretty much all my program did.
    >
    >> If you have even a small code sample I wouldn't mind reading it!

    >
    > I'm afraid I'm not at liberty to post it.


    Thanks anyway.

    I'm taking a look at text.py in the anaconda source code tree here:
    http://git.fedorahosted.org/git/anaconda.git?
    p=anaconda.git;a=blob_plain;f=text.py;hb=HEAD

    I'm afraid it looks as though newt was primarily built to display a
    series of forms in order, like an installer does, so it is inherently
    limited by that interface. However, it might still be what I can use...

    --
    Harishankar (http://harishankar.org http://literaryforums.org)
    Harishankar, Mar 27, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Boris Boutillier
    Replies:
    0
    Views:
    962
    Boris Boutillier
    Jun 15, 2004
  2. Cameron Laird
    Replies:
    1
    Views:
    639
    Josiah Carlson
    Apr 3, 2004
  3. Kenneth McDonald
    Replies:
    2
    Views:
    710
  4. Gabriel B.

    python newt under win32

    Gabriel B., Jan 24, 2005, in forum: Python
    Replies:
    0
    Views:
    384
    Gabriel B.
    Jan 24, 2005
  5. Efrat Regev
    Replies:
    1
    Views:
    590
    Bill Mill
    Mar 24, 2007
Loading...

Share This Page