• GUI suggestions wanted

    From Alan Grunwald@[email protected] to comp.lang.tcl on Mon Sep 1 13:27:39 2025
    From Newsgroup: comp.lang.tcl

    (tl;dr - skip to the ---)

    I'm working to extend a long-running project of mine that parses text
    files and loads the parsed content into a database.

    From time to time, I have a brainwave and extend he parser to wring out
    a little more content. Following this, I rebuild the database by
    re-parsing all the text.

    Some of the text sources lack some pretty fundamental items of data, and
    one in particular provides incorrect values for one datum.

    I'm cǔrrently extending the system to allow the client of the parser to provide default and override values to be saved, respectively if the
    parsed data doesn't provide data or if the data is known to be
    unreliable. To allow the existing contents of the database to be
    corrected I've developed a mechanism to modify data that's already been parsed.

    The next question that arises is what do to when rebuilding the
    database? I'm writing all the default and overriding values, as well as post-save modifications to the database (changed rows) and can replay
    them when the text files are re-parsed.

    The final issue is what to do if the user makes a mistake with a
    modification and wants to roll it back? My solution is that when the
    user starts a rebuild, I will present them a display of all the changed
    rows so they can specify which changes to retain.

    -----

    Now (at long last) for the question:

    How should I display the changed rows?

    My first thought is to use a treeview with nodes displaying some
    elementary data identifying the rows, which will expand to display all
    the changes if the user opens the nodes. However, I can't see what the
    user can do to signify that they want to retain (or better, discard) the changes. The simple solution is to click the row to toggle the
    retain/discard setting, but left-click is used to open/close the node. I
    could use right-click, middle-click or double-click but both seem non-intuitive.

    I could put a checkbox image in as a separate column and toggle
    retain/discard if the image is clicked and open/close the node if the
    click is elsewhere on the row. This seems ok, but I'd prefer it if the retain/discard image were to the left rather than the right of the text.
    Is it possible to determine whether the user has clicked on the image or
    the text part of a cell? If so, I could display an image to the left of
    the text using -image when creating the item and toggle it if it's clicked.

    I haven't investigated the possibilities of using the treeview behaviour
    of a tablelist. Would this allow me to put the treeview part in the
    rightmost column?

    I could use a canvas and do everything myself. This seems like an awful
    lot of work.

    Suggestions, please?

    Thanks,
    Alan
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Mon Sep 1 14:41:01 2025
    From Newsgroup: comp.lang.tcl

    Am 01.09.2025 um 14:27 schrieb Alan Grunwald:
    I haven't investigated the possibilities of using the treeview behaviour
    of a tablelist. Would this allow me to put the treeview part in the rightmost column?

    Yes. and it allows to use toggleswitch columns (or checkbuttons) and
    does all for you. It is also save for huge data.

    Harald
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Alan Grunwald@[email protected] to comp.lang.tcl on Mon Sep 1 20:59:18 2025
    From Newsgroup: comp.lang.tcl

    On 01/09/2025 13:41, Harald Oehlmann wrote:
    Am 01.09.2025 um 14:27 schrieb Alan Grunwald:
    I haven't investigated the possibilities of using the treeview
    behaviour of a tablelist. Would this allow me to put the treeview part
    in the rightmost column?

    Yes. and it allows to use toggleswitch columns (or checkbuttons) and
    does all for you. It is also save for huge data.

    Harald

    Thanks Harald,

    I've gone ahead and three-quarter implimented something with the native treeview and I now think I can use a classic tablelist, without any tree.

    Alan
    --- Synchronet 3.21a-Linux NewsLink 1.2