• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Better random screensaver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Better random screensaver


  • Subject: Re: Better random screensaver
  • From: Webb <email@hidden>
  • Date: Tue, 5 Nov 2002 20:58:27 +0800

I made one named RandomExtra in August.

Download:
http://webbingtec.fateback.com/download/randomextra10.dmg.sit

And source code:
http://webbingtec.fateback.com/download/randomextra10_src.dmg.sit

It will be popular? I am putting it on versiontracker now, to see YES or No...:-)

Code picked from RandomExtraView.m
================================================================
- (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview
{
NSBundle* thisBundle = [NSBundle bundleForClass:[self class]];
NSString* aString = nil;

self = [super initWithFrame:frame isPreview:isPreview];
if (self) {
if (isPreview) {
aString = [thisBundle localizedStringForKey:@"defaultContent" value:@"RandomExtra" table:nil];
[self renderTextWithString:aString];
}
else {
ScreenSaverModules* modules = [ScreenSaverModules sharedInstance];
NSString* moduleName = pickModule();
if (moduleName) {
id aModule = [modules loadModuleWithName:moduleName frame:frame isPreview:isPreview];

// Screen savers are subclasses of ScreenSaverView,
// packaged up in bundles and loaded by the screen saver application
// So just return an instance of another module here and the caller cannot know who I am
// This is just the key how we can do the "switch"
if ( aModule && [aModule isKindOfClass:[ScreenSaverView class]] ) {
[super dealloc];
self = [aModule retain];
} else {
aString = [thisBundle localizedStringForKey:@"activeFail"
value:@"Cannot active module \"%@\"!" table:nil];
[self renderTextWithString:[NSString stringWithFormat:aString,moduleName]];
}
} else {
aString = [thisBundle localizedStringForKey:@"pickFail"
value:@"I cannot pick a module for you!" table:nil];
[self renderTextWithString:aString];
}
}
}
return self;
}


Regards
Webb - http://www.webbingtec.com

On Wednesday, October 30, 2002, at 11:08 PM, Salter, Adam Q wrote:
> So... I have decided to try and make a screen saver randomiser to
> replace
> the current one...
>
> I understand how to make a "randomise" list by seaching all the likely
> places you would find a screensaver, but I can't see how to send the
> output
> of my randomly chosen external "screen saver".saver into the NSView of
> my
> screensaver.
>
> Can anybody provide any pointers?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Annoying runtime message
  • Next by Date: Re: NSDocuments without window associations
  • Previous by thread: Re: Annoying runtime message
  • Next by thread: Quicktime qnd cocoa
  • Index(es):
    • Date
    • Thread