From: Dave H. <gr...@gr...> - 2005-09-22 00:21:56
|
I'm trying to put images on an otherwise blank screen. The following code should do that, however, it errors out with "uninitialized constant OSX::NScreenSaverWindowLevel" if the two lines that are commented out are enabled. class PictureDisplay < OSX::NSWindowController def init() screenRect = OSX::NSScreen.screens.objectAtIndex(0).frame mainWindow = OSX::NSWindow.alloc displayScreen = OSX::NSScreen.screens.objectAtIndex(0) windowMask = OSX::NSBorderlessWindowMask windowBacking = OSX::NSBackingStoreRetained mainWindow.initWithContentRect_styleMask_backing_defer_screen(screenRect , windowMask, windowBacking, nil, displayScreen) #windowLevel = (OSX::NSWindow::NScreenSaverWindowLevel) # this fails #mainWindow.setLevel(windowLevel) mainWindow.setBackgroundColor(OSX::NSColor.blackColor) mainWindow.makeKeyAndOrderFront_ return self end end How do I get those constants defined? |
From: Jonathan P. <jp...@dc...> - 2005-09-22 10:23:14
|
On 22 Sep 2005, at 1:21, Dave Howell wrote: > I'm trying to put images on an otherwise blank screen. The > following code should do that, however, it errors out with > "uninitialized constant OSX::NScreenSaverWindowLevel" if the two > lines that are commented out are enabled. > > #windowLevel = (OSX::NSWindow::NScreenSaverWindowLevel) # > this fails > > How do I get those constants defined? (1) Reference OSX:: directly rather than OSX::NSWindow:: (2) Spell NSScreenSaverWindowLevel correctly :) NScreenSaverWindowLevel vs. NSScreenSaverWindowLevel |
From: kimura w. <ki...@us...> - 2005-09-22 12:31:31
|
Hi, Thu, 22 Sep 2005 11:23:01 +0100, Jonathan Paisley wrote: >On 22 Sep 2005, at 1:21, Dave Howell wrote: > >> I'm trying to put images on an otherwise blank screen. The >> following code should do that, however, it errors out with >> "uninitialized constant OSX::NScreenSaverWindowLevel" if the two >> lines that are commented out are enabled. >> >> #windowLevel = (OSX::NSWindow::NScreenSaverWindowLevel) # >> this fails >> >> How do I get those constants defined? > >(1) Reference OSX:: directly rather than OSX::NSWindow:: >(2) Spell NSScreenSaverWindowLevel correctly :) > > NScreenSaverWindowLevel >vs. > NSScreenSaverWindowLevel > > and.. The version 0.4.1 or earlier does not support constants about WindowLevel for a technical reason. The constants are available in CVS later 2005-07-16. -- kimura wataru |
From: Jonathan P. <jp...@dc...> - 2005-09-22 14:22:51
|
>> >> (1) Reference OSX:: directly rather than OSX::NSWindow:: >> (2) Spell NSScreenSaverWindowLevel correctly :) >> >> NScreenSaverWindowLevel >> vs. >> NSScreenSaverWindowLevel > > and.. The version 0.4.1 or earlier does not support constants about > WindowLevel for a technical reason. The constants are available in > CVS later 2005-07-16. Ah - my apologies for not checking this. I found the constant in my rubycocoa, but I'm running the CVS version so didn't think that it might not have been there before. |
From: Dave H. <gr...@gr...> - 2005-09-22 19:10:10
|
On Sep 22, 2005, at 7:21, Jonathan Paisley wrote: > Ah - my apologies for not checking this. I found the constant in my > rubycocoa, but I'm running the CVS version so didn't think that it > might not have been there before. A solution proposed for a different problem I was having was to "install darwinports." For this one, will only upgrading via CVS get me the version that has the constants defined? And to what, exactly, would I be upgrading to? |
From: Jonathan P. <jp...@dc...> - 2005-09-23 11:36:29
|
On 22 Sep 2005, at 20:09, Dave Howell wrote: > On Sep 22, 2005, at 7:21, Jonathan Paisley wrote: > >> Ah - my apologies for not checking this. I found the constant in >> my rubycocoa, but I'm running the CVS version so didn't think that >> it might not have been there before. >> > > A solution proposed for a different problem I was having was to > "install darwinports." For this one, will only upgrading via CVS > get me the version that has the constants defined? And to what, > exactly, would I be upgrading to? The 0.4.1 release of RubyCocoa does not have the constants. No newer version has yet been released. The 'CVS' version refers to whatever is the latest code changes made by the developers and committed to the CVS system (see, for example [1] and [2] to find out more about what CVS is). Releases are generally made when developers feel the updates made to the code are ready for public consumption. This means that the current CVS version may contain bugs or other unexpected behaviour. However, it's the only way to get newer features before they're given a versioned (e.g., 0.4.2) release. In summary: the CVS version is likely to contain more features and also bugfixes against 0.4.1, but may also introduce other bugs that may come to bite you. A temporary work-around would be to give the actual value for the constant. For example, NSScreenSaverWindowLevel is 1000. However, these 'constants' are defined in such a way by Mac OS X that they are derived at run-time (this is the reason that 0.4.1 doesn't support them), so it's not something to be relied upon long-term. Jonathan [1] http://www.nongnu.org/cvs/ [2] http://cvsbook.red-bean.com/cvsbook.html#Introduction |