Skip to main content
1-Visitor
May 2, 2013
Question

Toolbar button toggle?

  • May 2, 2013
  • 1 reply
  • 676 views
I've added a toolbar button by customising $APTCUSTOM/dialogs/editwindow.xml as suggested in previous Adepters answers. That's working fine.

My button calls a remote service that may or may not be available, and I'd like to change the state of the button to indicate this. It looks as if I can poll the remote service occasionally with timer_add_callback, but I can't see how to change the button to make it "disabled". Is this possible?


Jonathan Reeve
Practical Law Company










This e-mail from Practical Law Company (

    1 reply

    18-Opal
    May 2, 2013
    Hi Jonathan--

    Sure, you can do this using dlgitem_set() to toggle the "ACTIVE"
    attribute, like this:

    function updateToolbar() {
    local button_id = "Toolbar_AccessService"; # modify as necessary
    for your toolbar button ID
    if (serviceIsAvailable()) {
    # good to go, make the button available
    dlgitem_set(current_window(),$button_id ,"ACTIVE",1);
    }
    else {
    # something's wrong, so disable the button
    dlgitem_set(current_window(),$button_id ,"ACTIVE",0)
    }
    }

    --Clay

    Clay Helberg
    Senior Consultant

    TerraXML
    1380 Forest Park Circle, Suite 100
    Lafayette, CO 80027