OK, I think I have my user defaults mostly working and bound to my UI elements. Three questions that I have not found answers to:
-
Can I create a separator in my list for a pop-up button. If so how?
-
I have bindings set up for my pop-up button. They are :
This seems to work, but I could also use selected index, selected tag, and selected value. Can someone explain these to me a bit more, I read Apple’s Cocoa Bindings PDF which helped me a bit, but seems to leave out a lot of information on what the possible binding option actually are. The index seems logically to be the index of the item in the list, but tag and value represent what? The selected Tag option seems to work fine on another pop-up, but then I have not switched the list out on that one.
- I have my bindings set up in interface builder. In my application script I set up my initial values:
on will finish launching theObject
try
tell user defaults
(* Documnent Group *)
(* Page Group *)
make new default entry at end of default entries with properties {name:"PageSizes", content:{"Letter", "Tabloid"}}
make new default entry at end of default entries with properties {name:"PagePreset", content:"Tabloid"}
make new default entry at end of default entries with properties {name:"PageWidth", content:11}
make new default entry at end of default entries with properties {name:"PageHeight", content:17}
make new default entry at end of default entries with properties {name:"FacingPages", content:0}
(* Labels Group *)
make new default entry at end of default entries with properties {name:"FontList", content:{"Arial"}}
make new default entry at end of default entries with properties {name:"FontName", content:"Arial"}
make new default entry at end of default entries with properties {name:"FontSizeList", content:{7, 8, 9, 10, 11, 12}}
make new default entry at end of default entries with properties {name:"FontSize", content:10}
make new default entry at end of default entries with properties {name:"FontLeadingList", content:{7, 8, 9, 10, 11, 12}}
make new default entry at end of default entries with properties {name:"FontLeading", content:12}
end tell
end try
end will finish launching
Since the UI elements are bound to these defaults they update the defaults as they change. I will add a will quit handler to call:
call method "synchronize" of object user defaults
This should make sure that the user defaults are stored when the application closes so that the values are persistent between launches. Do I understand this correctly and is there anything else that I need to do?
Thanks,
Jerome