[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FYI and a few questions...
From: |
Fred Kiefer |
Subject: |
Re: FYI and a few questions... |
Date: |
Fri, 27 Jul 2007 17:36:35 +0200 |
User-agent: |
Thunderbird 1.5.0.12 (X11/20060911) |
Stefan Bidigaray wrote:
> My questions:
>
> 1) I still haven't figured out how I'm going to count how many minutes
> it's been since the last even, and much less how to even find out if
> events have happened. Does anyone have any ideas on how to do this?
>
This is easy. If your tool already uses an NSApplication, just subclass
this and have your own class do special things at the end of the
nextEventMatchingMask:untilDate:inMode:dequeue: method. (sendEvent:
would also do)
> 2) I also have no idea how to figure if, once the screen saver is on,
> how to stop if when something happens (mouse move, key stroke, mouse
> click). I've looked at the docs for NSView and there doesn't seem to be
> any methods that would make this easy. What can I do here?
>
Again this method does the job for you. If you set up an periodic event,
you even get that.
> 3) Once the preference module is completed and working, I'll need to
> have gssaver check the defaults after the preferences change, is there
> anyway I can send it a message asking it to check the defaults fromt the
> preference module?
>
The other way around. The screen saver has to register to get change
notifications from the defaults. This is how NSColor does it:
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(defaultsDidChange:)
name: NSUserDefaultsDidChangeNotification
object: nil];
> 4) Lastly, I'll need a lot of help creating ScreenSaverDefaults, but
> only later. I've check NSUserDefaults' code and I'm more confused now
> than I was when I started out. I figured for this, the best thing would
> be to create a new file (ScreenSaverDefaults) under the Defaults
> directory. NSUserDefaults, however, seems to be very picky about there
> being a process running and writing to that process.
>
You should just not worry about your settings being in a separate file
or not. GNUstep currently stores all defaults in one file, which btw I
do not like. All you need to do is to get and set your values from/in
[NSUserDefaults standardUserDefaults] and things should work as expected.
> After it's all said and done I'd like to add this to GNUstep as I think
> it would make more sense being distributed by it (much like
> SystemPreferences and it's NSPreferencePane implementation). I already
> have a copyright assignment, so it shouldn't be a problem.
>
Cheers,
Fred