• A Unix GUI man page viewer

    From Mark Summerfield@m.n.summerfield@gmail.com to comp.lang.tcl on Fri Aug 22 07:57:00 2025
    From Newsgroup: comp.lang.tcl

    I wanted to share a tiny (1 KLOC) Unix GUI man page viewer I made that uses Tcl/Tk 9.0.2.

    It is available here: https://github.com/mark-summerfield/manpager

    I’ve done it using TclOO which I find a lot more "natural" to my programming style (having programmed in Python for so long).

    Manpager makes use of some Tcl/Tk 9-specific features including:

    * callback - which I use a lot
    * my varname
    * lseq
    * exec’s -encoding argument (which is why it needs 9.0.2)
    * file home
    * oo::abstract

    The code I’m most pleased with is a minute (6 line) class:

    oo::class create Ref {
    variable Value
    constructor value { set Value $value }
    method get {} { return $Value }
    method set value { set Value $value }
    }

    I use this instead of using upvar. It allows me to wrap a value and pass it down the call stack as deep as I like just like a normal value, but at any point the value can be changed by using the set method. For a usage example
    see app_actions-1.tm’s on_config method and config_form-1.tm’s ConfigForm class.

    In my Store version control alternative https://github.com/mark-summerfield/manpager I use even more Tcl/Tk 9
    features including oo::singleton to lazily create dialog windows which I
    want to keep available (but hidden when not in use) to preserve their state, size, and position.

    I’ve found Ashok Nadkarni’s books really helpful. Just wish there was a volume covering Tk!

    All in all I am enjoying using Tcl/Tk 9 far more than I’ve ever enjoyed Tcl programming before.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Harald Oehlmann@wortkarg3@yahoo.com to comp.lang.tcl on Fri Aug 22 10:06:31 2025
    From Newsgroup: comp.lang.tcl

    Am 22.08.2025 um 09:57 schrieb Mark Summerfield:
    I wanted to share a tiny (1 KLOC) Unix GUI man page viewer I made that uses Tcl/Tk 9.0.2.

    It is available here: https://github.com/mark-summerfield/manpager

    I’ve done it using TclOO which I find a lot more "natural" to my programming
    style (having programmed in Python for so long).

    Manpager makes use of some Tcl/Tk 9-specific features including:

    * callback - which I use a lot
    * my varname
    * lseq
    * exec’s -encoding argument (which is why it needs 9.0.2)
    * file home
    * oo::abstract

    The code I’m most pleased with is a minute (6 line) class:

    oo::class create Ref {
    variable Value
    constructor value { set Value $value }
    method get {} { return $Value }
    method set value { set Value $value }
    }

    I use this instead of using upvar. It allows me to wrap a value and pass it down the call stack as deep as I like just like a normal value, but at any point the value can be changed by using the set method. For a usage example see app_actions-1.tm’s on_config method and config_form-1.tm’s ConfigForm class.

    In my Store version control alternative https://github.com/mark-summerfield/manpager I use even more Tcl/Tk 9 features including oo::singleton to lazily create dialog windows which I
    want to keep available (but hidden when not in use) to preserve their state, size, and position.

    I’ve found Ashok Nadkarni’s books really helpful. Just wish there was a volume covering Tk!

    All in all I am enjoying using Tcl/Tk 9 far more than I’ve ever enjoyed Tcl programming before.

    Hi Mark,
    thanks for the great news, I appreciate.

    Your Ref class remebers me to typical access functions to member
    variables in C++.

    Thanks for sharing,
    Harald
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Richard Owlett@rowlett@access.net to comp.lang.tcl on Fri Aug 22 06:15:16 2025
    From Newsgroup: comp.lang.tcl

    On 8/22/25 2:57 AM, Mark Summerfield wrote:
    I wanted to share a tiny (1 KLOC) Unix GUI man page viewer I made that uses Tcl/Tk 9.0.2.

    It is available here: https://github.com/mark-summerfield/manpager
    [snip]

    That page provides just enough to whet my interest
    I'm a retired Tcl/Tk newbie who hasn't used it for too long.
    You describe it as an alternative to gman - with which I'm unfamiliar
    and Synaptic doesn't give a "homepage" for it.

    Do you have a more complete description of your app?
    Is there a good description somewhere of gman that would give me an idea
    of what you wanted to accomplish?

    TIA


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mark Summerfield@m.n.summerfield@gmail.com to comp.lang.tcl on Fri Aug 22 15:12:20 2025
    From Newsgroup: comp.lang.tcl

    On Fri, 22 Aug 2025 06:15:16 -0500, Richard Owlett wrote:

    On 8/22/25 2:57 AM, Mark Summerfield wrote:
    I wanted to share a tiny (1 KLOC) Unix GUI man page viewer I made that uses >> Tcl/Tk 9.0.2.

    It is available here: https://github.com/mark-summerfield/manpager
    [snip]

    That page provides just enough to whet my interest
    I'm a retired Tcl/Tk newbie who hasn't used it for too long.
    You describe it as an alternative to gman - with which I'm unfamiliar
    and Synaptic doesn't give a "homepage" for it.

    Do you have a more complete description of your app?
    Is there a good description somewhere of gman that would give me an idea
    of what you wanted to accomplish?

    TIA

    In Debian 12 (bookworm)'s synaptic there's a gman package.
    But no mention of a home page.
    There's a screenshot of it here (scroll down about 40%): https://askubuntu.com/questions/253705/graphical-user-interface-to-view-man-page
    and a manual page here: https://manpages.ubuntu.com/manpages/xenial/man1/gman.1x.html
    It appears to be 26 years old and is maybe no longer maintained.

    The main reason I created my own is that gman always shows the man pages
    in an external viewer; I wanted them shown in the GUI app & also to
    have clickable man page links, e.g., if you click, say, man(1) that
    man page will appear.

    I don't have a more complete description of Manpager.
    If you install and run it (basically download a zip or clone it
    and put it anywhere -- providing you have a wish 9.0.2 in your
    path called wish9 & Tcllib & Tklib) it should be easy to use.
    The only help is in the tooltips.
    --- Synchronet 3.21a-Linux NewsLink 1.2