Popup buttons
Popup buttons
- Subject: Popup buttons
- From: Matthew Stuckwisch <email@hidden>
- Date: Sat, 30 Mar 2002 12:09:54 -0600
In an AppleScript Studio application I'm working on, I have a popup button
being used for the user to make a choice. But when I make either of these
two calls...
set category to title of popup button "popupList" as string
set category to current menu item of popup button "popupList" as string
...I always am returned the first choice, even after I've set it to a
different option. So, trying to be a bit creative, I tried the "on choose
menu item" event handler. Using the test code...
on choose menu item theObject
set category to the title of theObject as string
display dialog category
end choose menu item
...I found that I was able to retrieve that new choice, and then by adding
the line "set the enabled of theObject to true" I could get it to become
the choice...sort of. After changing the current choice, if I went back
to change it again I would see two check marks in the same popup button.
For example (this is a Hangman app, btw), when I pull up the menu the
first time, I see this:
Category: [bAnimals]
[ Jobs ]
[ Foods ]
[ Sports ]
After choosing a category, in the sheet it looks like this (as it should):
Category: [ Foods ]
But then if I try to open it up again, I see this, which to my knowledge
should not happen:
[bAnimals]
[ Jobs B ]
Category: [bFoods ]
[ Sports ]
Even manually doing the line in the "on choose menu item" handler "set
current menu item of popup button "popupList" to theObject" keeps it with
the strange double chosen bug. Same for "set the enabled of theObject to
true". I can't though use "set the enabled of current menu item of popup
button "popupList" to false", that results in an error.
Is this a bug in my coding somewhere or a bug in the system?
Matthew Stuckwisch
[AIM/MSN]{GuifaSwimmer} | [Yahoo!]{SapphireTree} | [ICQ]{137477701}
[IRC]{guifa / G}(esperNET / irc.massinova.com)
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.