zots
Re-member
I am rewriting an app in cocoa, that I originally wrote in RB. It looks like this:
You enter whatever transactions and they will update in the lower window. Then you do file>>save and it write the preference file which looks like this:
My first question; I want to know what you think is the best way to make the pref file with cocoa. NSMutableDictionary? Can I read and write an NSMutableDictionary to a file with NSFileHandle?
My second question is about the setContentSize method of NSWindow. In the first two images you see the main window has different heights when the Check radio button is clicked to account for the extra fields. Here is the code I used for this in cocoa:
This works but the window is resizing from the top, you can see in these images:
Thanks for your help.
You enter whatever transactions and they will update in the lower window. Then you do file>>save and it write the preference file which looks like this:
My first question; I want to know what you think is the best way to make the pref file with cocoa. NSMutableDictionary? Can I read and write an NSMutableDictionary to a file with NSFileHandle?
My second question is about the setContentSize method of NSWindow. In the first two images you see the main window has different heights when the Check radio button is clicked to account for the extra fields. Here is the code I used for this in cocoa:
Code:
NSSize checkSize,defaultSize;
checkSize.width = 320;
defaultSize.width = 320;
checkSize.height = 181;
defaultSize.height = 151;
switch ([optType selectedRow])
{
case -1://fall through
case 0://fall through
case 1://fall through
case 3://not a check
[[sender window] setContentSize:defaultSize];
[txtCheckNumber setEnabled:NO];
[txtPayCheckTo setEnabled:NO];
break;
case 2://a check
[[sender window] setContentSize:checkSize];
[txtCheckNumber setEnabled:YES];
[txtPayCheckTo setEnabled:YES];
break;
}
Thanks for your help.