• how to use diagram-viewer and the diagram pkg

    From Mark Summerfield@mark@qtrac.eu to comp.lang.tcl on Wed Jul 17 07:33:22 2024
    From Newsgroup: comp.lang.tcl

    I would like to try out the diagram-viewer app and the diagram pkg.
    I am using Tcl/Tk 9.0b2 on Linux.

    Given file /tmp/a.dia (copied from the tclwiki):

    box A
    arrow "" 40
    circle B
    direction SE

    I tried this at the command line:

    $ wish9 ~/opt/tcl9/bin/diagram-viewer show /tmp/a.dia
    Creating safe environment, please wait... /home/mark/opt/tcl9/bin/diagram-viewer: can't find package diagram
    $ wish9
    % package require diagram
    1

    As you can see, diagram-viewer can't find the diagram package even though
    it is there.

    Nor can I find any other examples of the diagram language nor what file extension one should use.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Mark Summerfield@mark@qtrac.eu to comp.lang.tcl on Wed Jul 17 07:35:54 2024
    From Newsgroup: comp.lang.tcl

    On Wed, 17 Jul 2024 07:33:22 +0000, Mark Summerfield wrote:

    I would like to try out the diagram-viewer app and the diagram pkg.
    I am using Tcl/Tk 9.0b2 on Linux.
    [snip]
    As you can see, diagram-viewer can't find the diagram package even
    though it is there.

    Nor can I find any other examples of the diagram language nor what file extension one should use.

    Sorry, keep forgetting that the Pan newsreader's editor eats (selected) newlines:

    The file /tmp/a.dia is (with no blank lines):

    box A

    arrow "" 40

    circle B

    direction SE

    And the console interaction (again with no blank lines):

    $ wish9 ~/opt/tcl9/bin/diagram-viewer show /tmp/a.dia

    Creating safe environment, please wait...

    /home/mark/opt/tcl9/bin/diagram-viewer: can't find package diagram

    $ wish9

    % package require diagram

    1
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Andreas Leitgeb@avl@logic.at to comp.lang.tcl on Wed Jul 17 08:15:36 2024
    From Newsgroup: comp.lang.tcl

    Mark Summerfield <mark@qtrac.eu> wrote:
    $ wish9 ~/opt/tcl9/bin/diagram-viewer show /tmp/a.dia
    Creating safe environment, please wait... /home/mark/opt/tcl9/bin/diagram-viewer: can't find package diagram
    $ wish9
    % package require diagram
    1

    The "Creating safe environment, please wait..." might be the key here.
    Check what the diagram viewer does after emitting that line, and see
    if you can still "package require diagram" in that context.

    If the "safe environment" is related to a safe interpreter,
    you might need to add more code to the diagram-viewer to
    allow the safe interp to load that particular package.

    If I had it in my head, I'd write it - I hope someone else
    can describe the extra "magic" needed to enable a package
    in a safe interp.

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Harald Oehlmann@wortkarg3@yahoo.com to comp.lang.tcl on Wed Jul 17 13:16:04 2024
    From Newsgroup: comp.lang.tcl

    Am 17.07.2024 um 10:15 schrieb Andreas Leitgeb:
    Mark Summerfield <mark@qtrac.eu> wrote:
    $ wish9 ~/opt/tcl9/bin/diagram-viewer show /tmp/a.dia
    Creating safe environment, please wait...
    /home/mark/opt/tcl9/bin/diagram-viewer: can't find package diagram
    $ wish9
    % package require diagram
    1

    The "Creating safe environment, please wait..." might be the key here.
    Check what the diagram viewer does after emitting that line, and see
    if you can still "package require diagram" in that context.

    If the "safe environment" is related to a safe interpreter,
    you might need to add more code to the diagram-viewer to
    allow the safe interp to load that particular package.

    If I had it in my head, I'd write it - I hope someone else
    can describe the extra "magic" needed to enable a package
    in a safe interp.


    May you identify the "pckIndex.tcl" file of the package and post it here?
    It may contain code to exclude TCL9...

    Take care,
    Harald
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Mark Summerfield@mark@qtrac.eu to comp.lang.tcl on Fri Jul 19 07:22:06 2024
    From Newsgroup: comp.lang.tcl

    On Wed, 17 Jul 2024 13:16:04 +0200, Harald Oehlmann wrote:
    [snip]
    May you identify the "pckIndex.tcl" file of the package and post it
    here?
    It may contain code to exclude TCL9...


    I installed Tcl 9.0b2 in ~/opt/tcl9, then installed Tk 9.0b2 in the same
    place then installed the trunk versions of Tcllib and Tklib using their installers run using wish9 (my link to ~/opt/tcl9/bin/wish9.0).

    The diagram-viewer was installed by this process in ~/opt/tcl9/bin and
    that dir has no pkgIndex.tcl file.

    In other words I just did a standard install.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Andreas Leitgeb@avl@logic.at to comp.lang.tcl on Fri Jul 19 12:26:50 2024
    From Newsgroup: comp.lang.tcl

    Harald Oehlmann <wortkarg3@yahoo.com> wrote:
    Am 17.07.2024 um 10:15 schrieb Andreas Leitgeb:
    Mark Summerfield <mark@qtrac.eu> wrote:
    $ wish9 ~/opt/tcl9/bin/diagram-viewer show /tmp/a.dia
    Creating safe environment, please wait...
    /home/mark/opt/tcl9/bin/diagram-viewer: can't find package diagram
    $ wish9
    % package require diagram
    1

    The "Creating safe environment, please wait..." might be the key here.
    Check what the diagram viewer does after emitting that line, and see
    if you can still "package require diagram" in that context.

    If the "safe environment" is related to a safe interpreter,
    you might need to add more code to the diagram-viewer to
    allow the safe interp to load that particular package.

    If I had it in my head, I'd write it - I hope someone else
    can describe the extra "magic" needed to enable a package
    in a safe interp.

    May you identify the "pckIndex.tcl" file of the package and post it here?
    It may contain code to exclude TCL9...

    I think we can exclude that possibility, because the package apparently
    does load successfully in an interactive wish9.

    Mark, if you skipped a few post and just read the last one, consider
    what I wrote about safe interpreters.

    --- Synchronet 3.20a-Linux NewsLink 1.114