• bind click on combobox arrow button

    From Alexandru@21:1/5 to All on Thu Aug 3 13:26:08 2023
    How can I bind a function to the click on combobox arrow button?
    I want to create the listvariable dynamically, when the user wants to show the dropdown list.

    Many thanks
    Alexandru

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to Alexandru on Thu Aug 3 16:50:24 2023
    On 8/3/2023 1:26 PM, Alexandru wrote:
    How can I bind a function to the click on combobox arrow button?
    I want to create the listvariable dynamically, when the user wants to show the dropdown list.

    Many thanks
    Alexandru
    I think you want the -postcommand option. That will call the given function on the left click of the popdown arrow, and it can both set the current value as well as the popdown list values. For example, this will set 3 values and also set 1 as the
    current value:

    ttk::combobox .cb -postcommand cbpost -textvariable mytext
    pack .cb
    proc cbpost {} {.cb config -values {1 2 3};set ::mytext 1}

    The values you set need not be a constant as in this example.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandru@21:1/5 to All on Fri Aug 4 00:08:11 2023
    et99 schrieb am Freitag, 4. August 2023 um 01:50:29 UTC+2:
    On 8/3/2023 1:26 PM, Alexandru wrote:
    How can I bind a function to the click on combobox arrow button?
    I want to create the listvariable dynamically, when the user wants to show the dropdown list.

    Many thanks
    Alexandru
    I think you want the -postcommand option. That will call the given function on the left click of the popdown arrow, and it can both set the current value as well as the popdown list values. For example, this will set 3 values and also set 1 as the
    current value:

    ttk::combobox .cb -postcommand cbpost -textvariable mytext
    pack .cb
    proc cbpost {} {.cb config -values {1 2 3};set ::mytext 1}

    The values you set need not be a constant as in this example.

    That's it! Thank you!
    Cheers
    Alexandru

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