Re: [newbie] Window state saving (clarifications)
Re: [newbie] Window state saving (clarifications)
- Subject: Re: [newbie] Window state saving (clarifications)
- From: Jonathan Saggau <email@hidden>
- Date: Sun, 15 Jan 2006 05:39:47 -0500
First thing's first: Thanks for the responses (already!)
A screenshot of the app is available at
http://jonathansaggau.com/cocoa-dev/slider.jpg (I know, read the HIG...)
It's a little toy; I'm using it to learn pyobjc and to connect some python
classes to SuperCollider. Then, I plan to rewrite it in Objective-C to
learn the memory management stuff better and to get more comfortable with
the messaging style and [[bracket syntax] init] while learning how to
instantiate a python object in obj-c.
(There is probably more info ^there than you need, but I get excited by this
stuff)
The plist I'm using to save the state looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>properties</key>
<dict>
<key>Port Number</key>
<string>57110</string>
<key>SCServer IP</key>
<string>127.0.0.1</string>
<key>SynthNode Number</key>
<string>1000</string>
<key>Variable Name</key>
<string>vol</string> #these are all strings for compatibility with
a python class I'm using...
</dict>
<key>state</key>
<dict>
<key>currentSliderValue</key>
<real>0.0</real>
<key>label</key>
<string>Slider Label</string>
<key>maxSliderValue</key>
<real>100</real>
<key>minSliderValue</key>
<real>0.0</real>
<key>Window On Top</key>
<false/>
</dict>
</dict>
</plist>
On load of the document, it gets gui state from the plist and on save, it
dumps the positions of the widgets into the plist. It does so quickly and
everything is working, but I just knew that there would be something slick
and cocoa-like I could learn. I'll be looking at the cocoa bindings
tutorials online and in my Hillegass book tomorrow (thanks again).
Cheers,
Jonathan Saggau
--
The extent to which an individual can resist being blindly led by tradition
is a good measure of his vitality. - Harry Partch
There is a computer disease that anybody who works with computers knows
about. It's a very serious disease and it interferes completely with the
work. The trouble with computers is that you 'play' with them! - Richard P.
Feynman
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden