Sunday, December 17, 2017

#1 2011-04-01 08:03:18 pm

Boberino
Member
From:: San Diego, California
Registered: 2008-04-05
Posts: 43
Website

Dialog Box Not Reactivating

I am working in AppleScript Studio and XCode 3.2.6.  I have a dialog box on the screen with a number of text fields, buttons, etc., in the dialog box and running just fine.

In this dialog box I also have a combo box called "COA" that was previously populated with a list of items.  It also seems fine.

When a user chooses an item from the combo box, by dropping it down and selecting an item from the list, I use the "Action" Event Handler as below.  This adds the item selected from the combo box to a list of items selected, unless the user has previously selected that item.  And up to here everything works fine.

However, when the user goes back to the dialog box, any item selected must be clicked on twice to work (ANY item: buttons, text field, the combo box, etc.  Even the cursor in the text field stops blinking until the user clicks on something first.)  The first click on anything (even just the window) seems to "activate" the dialog box and the second then does the work.  I tried using the "Activate" instruction (see commented line), but that didn't fix it.

Can anyone shed some light on this mystery?

--------  Action Event Handler Starts Here
on action theObject
   
    tell window of theObject --The dialog of theObject
       
        set itemPicked to content of combo box "COA"
       
        if COAList does not contain itemPicked then
            set COAList to COAList & itemPicked
        else
            beep
        end if
       
    set content of table view "TVCOA" of scroll view "SVCOA" to COAList --Populate the table view again

    --Activate
       
    end tell
   
end action

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)