• Controlling button state in a form

    From Vince Refiti@21:1/5 to All on Wed May 6 18:09:28 2020
    Hi

    What is the easiest way to control the enabled/disabled (or any other attribute) of a button according the state of one or more other components in a form? Basically I want to disable a button unless some other input is valid.

    How do I refer to a button from the #createComponents or #model: methods?

    Thanks in advance, Vince

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From klausk@21:1/5 to All on Wed May 6 23:02:10 2020
    Am Donnerstag, 7. Mai 2020 03:09:29 UTC+2 schrieb Vince Refiti:
    Hi

    What is the easiest way to control the enabled/disabled (or any other attribute) of a button according the state of one or more other components in a form? Basically I want to disable a button unless some other input is valid.

    How do I refer to a button from the #createComponents or #model: methods?

    Thanks in advance, Vince

    Same question here: https://groups.google.com/forum/#!topic/comp.lang.smalltalk.dolphin/Pj9Flq3i3yM

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Vince Refiti@21:1/5 to All on Thu May 7 01:30:45 2020
    Let me see if I got this straight:

    A polling loop calls #queryCommand: on a collection of items in a Presenter. So #queryCommand: should be overridden in my particular Presenter subclass so that for an item of interest (a button in my case) I will implement code to check some state and to
    enable or disable it accordingly.

    Thanks Klaus

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From john c@21:1/5 to All on Thu May 7 05:15:27 2020
    hi,

    i have had luck using a boolean. the boolean value is set by your input editting. in queryCommand you enable or disable the method associated with the button based on that boolean.

    john

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