• How to better insert columns in a grid-managed frame

    From Michael Soyka@21:1/5 to All on Mon Jul 3 12:05:22 2023
    Hello all.

    I've built a GUI that is used for data entry. It consists of one column
    of row labels on the left, one column of checkbutton widgets on the
    right and multiple columns of entry widgets in between. Each entry
    widget column corresponds to a date and those columns must be shown in time-order. The top row contains label widgets for column captions.
    All are managed by grid.

    I would like the user to be able to insert additional columns of entry
    widgets at any time, analogous to inserting new columns in a
    spreadsheet. As the entry-columns must remain in time-order, some
    columns must be shifted to the right.

    Maybe I'm wrong but the grid geometry manager does not make this an easy
    task to implement. First, it doesn't support an insertion operation,
    just replace or append. So, what I had to do was to tell grid to
    remove/forget the columns to the right of the insertion point, append
    the new column and then append the forgotten ones. However, that messes
    up the stacking order because the new widgets are newer than the ones to
    their right.

    That can be solved either by destroying and then recreating the columns
    to be right-shifted or just destroying all of them and then recreating
    them in the desired order. Either approach works.

    Nonetheless, I didn't like either one and so what I've done is to force
    to user to specify up-front how many columns will be needed and then
    build the GUI.

    So I'm asking for alternatives that would allow the user to dynamically
    insert columns whenever the mood strikes. I've looked about for
    existing packages that support this type of operation but haven't found
    one.

    Thanks in advance for any suggestions.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Michael Soyka on Mon Jul 3 16:58:08 2023
    Michael Soyka <mssr953@gmail.com> wrote:
    Hello all.

    I've built a GUI that is used for data entry. It consists of one column
    of row labels on the left, one column of checkbutton widgets on the
    right and multiple columns of entry widgets in between. Each entry
    widget column corresponds to a date and those columns must be shown in time-order. The top row contains label widgets for column captions.
    All are managed by grid.

    I would like the user to be able to insert additional columns of entry widgets at any time, analogous to inserting new columns in a
    spreadsheet. As the entry-columns must remain in time-order, some
    columns must be shifted to the right.

    Maybe I'm wrong but the grid geometry manager does not make this an easy
    task to implement. First, it doesn't support an insertion operation,
    just replace or append. So, what I had to do was to tell grid to remove/forget the columns to the right of the insertion point, append
    the new column and then append the forgotten ones. However, that messes
    up the stacking order because the new widgets are newer than the ones to their right.

    As long as the new ones are above the container which is "gridding"
    them all, how is this a problem? And new ones, by being new, and on
    top, should always be above the container performing the grid
    management.

    That can be solved either by destroying and then recreating the columns
    to be right-shifted or just destroying all of them and then recreating
    them in the desired order. Either approach works.

    No need to destroy anything to change the stacking order. Just 'raise'
    the widgets that need to be raised.

    So I'm asking for alternatives that would allow the user to
    dynamically insert columns whenever the mood strikes. I've looked
    about for existing packages that support this type of operation but
    haven't found one.

    Have you tried using a treeview (without using the tree portion). It
    allows its columns to be ordered in an arbitrary order, so you could
    create a new column, then position it where you want and the rest
    should adjust accordingly.

    Another alternative could be tablelist (https://www.nemethi.de/). It
    has insertcolumns and deletecolumns subcommands which would seem to be
    just what you are asking for.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Mon Jul 3 18:54:57 2023
    * Michael Soyka <mssr953@gmail.com>
    | So I'm asking for alternatives that would allow the user to
    | dynamically insert columns whenever the mood strikes. I've looked
    | about for existing packages that support this type of operation but haven't
    | found one.

    Did you check tablelist?

    https://www.nemethi.de

    See also the recent post by Csaba regarding the current new version

    Message-ID: <u7u8bn$23esr$1@tota-refugium.de>
    ANNOUNCE: Multi-column listbox and tree widget package Tablelist 6.22

    HTH
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Soyka@21:1/5 to Ralf Fassel on Mon Jul 3 15:37:14 2023
    On 07/03/2023 12:54 PM, Ralf Fassel wrote:
    * Michael Soyka <mssr953@gmail.com>
    | So I'm asking for alternatives that would allow the user to
    | dynamically insert columns whenever the mood strikes. I've looked
    | about for existing packages that support this type of operation but haven't | found one.

    Did you check tablelist?

    https://www.nemethi.de
    I think I did but I'll have another look-see. Thanks!

    See also the recent post by Csaba regarding the current new version

    Message-ID: <u7u8bn$23esr$1@tota-refugium.de>
    ANNOUNCE: Multi-column listbox and tree widget package Tablelist 6.22

    HTH
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Soyka@21:1/5 to Rich on Mon Jul 3 15:48:06 2023
    On 07/03/2023 12:58 PM, Rich wrote:
    Michael Soyka <mssr953@gmail.com> wrote:
    Hello all.

    I've built a GUI that is used for data entry. It consists of one column
    of row labels on the left, one column of checkbutton widgets on the
    right and multiple columns of entry widgets in between. Each entry
    widget column corresponds to a date and those columns must be shown in
    time-order. The top row contains label widgets for column captions.
    All are managed by grid.

    I would like the user to be able to insert additional columns of entry
    widgets at any time, analogous to inserting new columns in a
    spreadsheet. As the entry-columns must remain in time-order, some
    columns must be shifted to the right.

    Maybe I'm wrong but the grid geometry manager does not make this an easy
    task to implement. First, it doesn't support an insertion operation,
    just replace or append. So, what I had to do was to tell grid to
    remove/forget the columns to the right of the insertion point, append
    the new column and then append the forgotten ones. However, that messes
    up the stacking order because the new widgets are newer than the ones to
    their right.

    As long as the new ones are above the container which is "gridding"
    them all, how is this a problem? And new ones, by being new, and on
    top, should always be above the container performing the grid
    management.
    Users will want to enter data left-to-right using the tab key. As a
    result of the above approach, the new column is skipped over and those
    widgets will be accessed after the widget in the lower-right. At least
    that's what I see and interpreted the behavior as a stacking order issue.

    That can be solved either by destroying and then recreating the columns
    to be right-shifted or just destroying all of them and then recreating
    them in the desired order. Either approach works.

    No need to destroy anything to change the stacking order. Just 'raise'
    the widgets that need to be raised.
    Obviously, I never though of that! Note to self- why didn't I think of
    that?

    So I'm asking for alternatives that would allow the user to
    dynamically insert columns whenever the mood strikes. I've looked
    about for existing packages that support this type of operation but
    haven't found one.

    Have you tried using a treeview (without using the tree portion). It
    allows its columns to be ordered in an arbitrary order, so you could
    create a new column, then position it where you want and the rest
    should adjust accordingly.

    Another alternative could be tablelist (https://www.nemethi.de/). It
    has insertcolumns and deletecolumns subcommands which would seem to be
    just what you are asking for.
    Thanks again for the suggestions- I'll look into them both.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)