I have four NSPopup buttons that have number’s 1 to 6 added to each upon nib waking,
I can change the values in each to be what ever number I choose at the moment, what I am wanting to
add is when a check box is checked to on, have all the NSPopup buttons change to the same
number that is selected in any of the other three popup buttons, can some one help me
to figure this out please, the check box part I have as below.
property Corner_Radius : missing value -- check box
property Corner_R : missing value
on Corner_R_(sender) --clicked to check or uncheck
Corner_Radius's intValue() --get state of check box 1 or 0
if result is 1 then
” code for making all popup buttons have the same number
no matter which popup button has been selected
end if
end Corner_R_
This will simple change them. There is no action for when the check box is unchecked so they stay the same.
i.e if when the check box is checked. The titles are all 1s. Uncheck it they remain All 1s.
property Corner_Radius : missing value -- check box
property Corner_R : missing value
property popUps : missing value -- Popup Button
on Corner_R_(sender) --clicked to check or uncheck
Corner_Radius's intValue() --get state of check box 1 or 0
if result is 1 then
set theSelectedTitle to popUps's selectedItem()'s title
set theItemArray to popUps's itemArray
repeat with i from 1 to number of items in theItemArray
set this_item to item i of theItemArray
this_item's setTitle:theSelectedTitle
end repeat
end if
end Corner_R_
This will revert them.
i.e if when the check box is checked. The titles are all 1s. Uncheck it they go back to what they were before.
property Corner_Radius : missing value -- check box
property Corner_R : missing value
property popUps : missing value
property bigList : {}
on Corner_R_(sender) --clicked to check or uncheck
set theItemArray to popUps's itemArray
set theSelectedTitle to popUps's selectedItem()'s title
set checked to Corner_Radius's intValue() --get state of check box 1 or 0
if checked is 1 then
set bigList to {}
end if
repeat with i from 1 to number of items in theItemArray
set this_item to item i of theItemArray
copy this_item's title to end of bigList
if checked is 1 then
this_item's setTitle:theSelectedTitle
else
this_item's setTitle: (item i of bigList)
end if
end repeat
looks promising, I see you have only one ppoup button, I have four
that when if any one is selected, that the number that is selected is then the same in the other three popup’s
my popup buttons are
property TopLeft : missing value
property TopRight : missing value
property BottomLeft : missing value
property BottomRight : missing value
property Corner_Radius : missing value -- check box
property Corner_R : missing value
property TopLeft : missing value
property TopRight : missing value
property BottomLeft : missing value
property BottomRight : missing value
property thePopupList : {}
on Corner_R_(sender) --clicked to check or uncheck
set checked to Corner_Radius's intValue() --get state of check box 1 or 0
if checked is 1 then
set thePopupList to {TopLeft,TopRight,BottomLeft,BottomRight}
set theSelectedItemIndex to sender's indexOfSelectedItem()
repeat with i from 1 to number of items in thePopupList
set this_item to item i of thePopupList
this_item's selectItemAtIndex:theSelectedItemIndex
end repeat
end if
end Corner_R_
that’s right Stefan, CornerR is connected to the check box, so when it’s checked
Corner_Radius’s intValue() knows that it’s result is either 1 or 0
which then if 1 runs the code, so is there another way to get the info
from the 4 drop box’s, to do what i’m after?