[macruby-changes] [845] MacRuby/trunk/sample-macruby/HotCocoa

source_changes at macosforge.org source_changes at macosforge.org
Fri Mar 6 21:16:43 PST 2009


Revision: 845
          http://trac.macosforge.org/projects/ruby/changeset/845
Author:   lsansonetti at apple.com
Date:     2009-03-06 21:16:43 -0800 (Fri, 06 Mar 2009)
Log Message:
-----------
adding round_transparent_window, round_transparent_window_no_nibs and download_and_progress_indicator HotCocoa examples (contributed by Matt Aimonetti)

Modified Paths:
--------------
    MacRuby/trunk/sample-macruby/HotCocoa/README

Added Paths:
-----------
    MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/
    MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/Rakefile
    MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/config/
    MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/config/build.yml
    MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/lib/
    MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/lib/application.rb
    MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/lib/menu.rb
    MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/resources/
    MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/resources/HotCocoa.icns
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/Rakefile
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/config/
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/config/build.yml
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/application.rb
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/custom_view.rb
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/custom_window.rb
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/menu.rb
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/nib_controller.rb
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/HotCocoa.icns
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/MainMenu.nib/
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/MainMenu.nib/designable.nib
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/MainMenu.nib/keyedobjects.nib
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/circle.tif
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/pentagram.tif
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/Rakefile
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/config/
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/config/build.yml
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/application.rb
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/custom_view_behaviors.rb
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/custom_window_behaviors.rb
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/menu.rb
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/resources/
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/resources/HotCocoa.icns
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/resources/circle.tif
    MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/resources/pentagram.tif

Modified: MacRuby/trunk/sample-macruby/HotCocoa/README
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/README	2009-03-07 05:08:47 UTC (rev 844)
+++ MacRuby/trunk/sample-macruby/HotCocoa/README	2009-03-07 05:16:43 UTC (rev 845)
@@ -1,3 +1,5 @@
+== HotCocoa Examples ==
+
 This directory contains a few demos of using the HotCocoa library.
 
 To learn more about HotCocoa see:
@@ -24,26 +26,29 @@
 After generating the structure, cd into that directory and run 
 macrake to build.
 
-Demos:
+== Examples ==
 
-calculator    #=> simple calculator example
-demo          #=> demo of many hotcocoa wrappers
-layout_view   #=> demo of using the layout view system
+calculator: a simple calculator example.
 
-Building the demos:
+demo: demo of many hotcocoa wrappers.
 
-Calculator:
-$ cd calculator
-$ macrake
+layout_view: demo of using the layout view system.
 
-Demo:
-$ cd demo
-$ macrake
+round_transparent_window: port of an Apple sample showing how to use hotcocoa 
+with a nib files.
 
-Layout View:
-$ cd layout_view
+round_transparent_window_no_nibs: same as round_transparent_window but without
+using any nibs.
+
+download_and_progress_indicator: demo of downloading data, progress indicator
+and scroll view containing a text view.
+
+Building the examples:
+
+$ cd <example-directory>
 $ macrake
 
-Graphics:
+== HotCocoa::Graphics Examples ==
+
 $ cd graphics
 $ open -a textedit README

Added: MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/Rakefile
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/Rakefile	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/Rakefile	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,4 @@
+require 'hotcocoa/application_builder'
+require 'hotcocoa/standard_rake_tasks'
+
+task :default => [:run]
\ No newline at end of file


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/Rakefile
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/config/build.yml
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/config/build.yml	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/config/build.yml	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,8 @@
+name: Download And progress bar
+load: lib/application.rb
+version: "1.0"
+icon: resources/HotCocoa.icns
+resources:
+  - resources/**/*.*
+sources: 
+  - lib/**/*.rb


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/config/build.yml
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/lib/application.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/lib/application.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/lib/application.rb	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,109 @@
+require 'hotcocoa'
+include HotCocoa
+
+TEXT_FILE = "http://www.gutenberg.org/files/4300/4300.txt"
+
+class Application
+
+  def start
+    @app = application(:name   => "Download And Progress Bar") do |app|
+      app.delegate = self
+      @window = window(:frame     => [100, 100, 500, 500], :title => "Download And Progress Bar") do |win|
+        win <<  label(:text => "Cocoa made easy! Example by Matt Aimonetti", :layout => {:start => false})
+        @status = label(:text => "downloading remote data", :layout => {:start => false}, :frame => [0, 0, 300, 20])
+        win <<  @status
+        win << @progress_bar = progress_indicator
+        
+        # Setup a scroll view containing a text view which will display the downloaded data
+        @scroll_view = scroll_view(:frame => [0,0,495,300], :layout => {:expand => [:height, :width]})
+        @text_view = text_view(:frame => [0,0,490,300])
+        @scroll_view.document_view = @text_view
+        
+        win << @scroll_view 
+        
+        @reload_button = button(:title => "Reload the data", :on_action => reload_data)
+        @reload_button.hidden = true
+        
+        win << @reload_button
+        
+        initiate_request(TEXT_FILE, self)  
+        win.will_close { exit }
+      end
+    end
+  end
+  
+  # Returns a proc that is being called by the reload button
+  def reload_data
+    Proc.new { 
+      # Change the progress bar_style
+      @progress_bar.style = :spinning
+      initiate_request(TEXT_FILE, self)
+      @reload_button.hidden = true 
+      @text_view.string = " Reloading..."
+      @status.text  = 're downloading the text file'
+    }
+  end
+  
+  # Request helper setting up a connection and a delegate
+  # used to monitor the transfer
+  def initiate_request(url_string, delegator)
+    url         = NSURL.URLWithString(url_string)
+    request     = NSURLRequest.requestWithURL(url)
+    @connection = NSURLConnection.connectionWithRequest(request, delegate:delegator)
+  end
+  
+  # Delegate method
+  #
+  # The transfer is done and everything went well
+  def connectionDidFinishLoading(connection)
+    @status.text  = "Data totally retrieved"
+    @progress_bar.hide
+    @progress_bar.reset
+    page          = NSString.alloc.initWithData(@receivedData, encoding:NSUTF8StringEncoding)
+    @receivedData = nil
+    begin 
+      @text_view.string = page
+    rescue
+      @status.text = "couldn't display the loaded text"
+    end
+    NSLog("data fully received")
+    @reload_button.hidden = false
+  end
+  
+  # Delegate method
+  #
+  # Deal with the request response 
+  # Note: in Ruby, the method name is the method signature
+  # Objective C uses what's called a selector
+  # The objc selector for the method below would be:
+  #   `connection:didReceiveResponse:`
+  def connection(connection, didReceiveResponse:response)
+    @status.text = (response.statusCode == 200) ? "Retrieving data" : "There was an issue while trying to access the data"
+    expected_size = response.expectedContentLength.to_f
+    # If we know the size of the document we are downloading
+    # we can determine the progress made so far
+    if expected_size > 0
+      @progress_bar.indeterminate = false
+      @progress_bar.maxValue = expected_size.to_f
+    end
+    @progress_bar.show
+    @progress_bar.start
+    NSLog("extected response length: #{response.expectedContentLength.to_s}")
+  end
+  
+  # Delegate method
+  #
+  # This delegate method get called every time a chunk of data
+  # is being received
+  def connection(connection, didReceiveData:receivedData)
+    @status.text  = "Data being retrieved"
+    # Initiate an ivar to store the received data
+    @receivedData ||= NSMutableData.new
+    @receivedData.appendData(receivedData)
+    @progress_bar.incrementBy(receivedData.length.to_f)
+    NSLog("data chunck received so far: #{@progress_bar.value.to_i}")
+  end
+  
+end
+
+Application.new.start
\ No newline at end of file


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/lib/application.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/lib/menu.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/lib/menu.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/lib/menu.rb	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,32 @@
+module HotCocoa
+  def application_menu
+    menu do |main|
+      main.submenu :apple do |apple|
+        apple.item :about, :title => "About #{NSApp.name}"
+        apple.separator
+        apple.item :preferences, :key => ","
+        apple.separator
+        apple.submenu :services
+        apple.separator
+        apple.item :hide, :title => "Hide #{NSApp.name}", :key => "h"
+        apple.item :hide_others, :title => "Hide Others", :key => "h", :modifiers => [:command, :alt]
+        apple.item :show_all, :title => "Show All"
+        apple.separator
+        apple.item :quit, :title => "Quit #{NSApp.name}", :key => "q"
+      end
+      main.submenu :file do |file|
+        file.item :new, :key => "n"
+        file.item :open, :key => "o"
+      end
+      main.submenu :window do |win|
+        win.item :minimize, :key => "m"
+        win.item :zoom
+        win.separator
+        win.item :bring_all_to_front, :title => "Bring All to Front", :key => "o"
+      end
+      main.submenu :help do |help|
+        help.item :help, :title => "#{NSApp.name} Help"
+      end
+    end
+  end
+end


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/lib/menu.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/resources/HotCocoa.icns
===================================================================
(Binary files differ)


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/download_and_progress_indicator/resources/HotCocoa.icns
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/Rakefile
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/Rakefile	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/Rakefile	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,4 @@
+require 'hotcocoa/application_builder'
+require 'hotcocoa/standard_rake_tasks'
+
+task :default => [:run]
\ No newline at end of file


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/Rakefile
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/config/build.yml
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/config/build.yml	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/config/build.yml	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,8 @@
+name: Round Transparent Window
+load: lib/application.rb
+version: "1.0"
+icon: resources/HotCocoa.icns
+resources:
+  - resources/**/*.*
+sources: 
+  - lib/**/*.rb


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/config/build.yml
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/application.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/application.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/application.rb	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,48 @@
+require 'hotcocoa'
+SOURCE_DIR = File.expand_path(File.dirname(__FILE__))
+require SOURCE_DIR + '/nib_controller'
+require SOURCE_DIR + '/controller'
+require SOURCE_DIR + '/custom_view'
+require SOURCE_DIR + '/custom_window'
+
+# Replace the following code with your own hotcocoa code
+
+class Application
+
+  include HotCocoa
+  
+  def start
+    application :name => "HotCocoa: Round Transparent Window" do |app|
+      app.delegate = self
+      # load our nib
+      NibController.new
+    end
+  end
+  
+  # file/open
+  def on_open(menu)
+  end
+  
+  # file/new 
+  def on_new(menu)
+  end
+  
+  # help menu item
+  def on_help(menu)
+  end
+  
+  # This is commented out, so the minimize menu item is disabled
+  #def on_minimize(menu)
+  #end
+  
+  # window/zoom
+  def on_zoom(menu)
+  end
+  
+  # window/bring_all_to_front
+  def on_bring_all_to_front(menu)
+  end
+  
+end
+
+Application.new.start
\ No newline at end of file


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/application.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/custom_view.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/custom_view.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/custom_view.rb	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,40 @@
+# Description: 	This is the header file for the CustomView class, which handles the drawing of the window content.
+#               we use a circle graphic and a pentagram graphic, switching between the two depending upon the 
+#               window's transparency.
+
+class CustomView < NSView
+
+  # This method is called at app launch time when this class is unpacked from the nib.
+  # We get set up here.
+  def awakeFromNib
+    # load the images we'll use from the bundle's Resources directory
+    @circle_image = NSImage.imageNamed("circle")
+    @penta_image  = NSImage.imageNamed("pentagram")
+    # tell ourselves that we need displaying (force redraw)
+    setNeedsDisplay(true)
+  end
+
+  # When it's time to draw, this method is called.
+  # This view is inside the window, the window's opaqueness has been turned off,
+  # and the window's styleMask has been set to NSBorderlessWindowMask on creation,
+  # so what this view draws *is all the user sees of the window*.  The first two lines below
+  # then fill things with "clear" color, so that any images we draw are the custom shape of the window,
+  # for all practical purposes.  Furthermore, if the window's alphaValue is <1.0, drawing will use
+  # transparency.
+  def drawRect(rect)
+    # erase whatever graphics were there before with clear
+    NSColor.clearColor.set
+    NSRectFill(frame)   
+    # if our window transparency is >0.7, we decide to draw the circle.  Otherwise, draw the pentagram.
+    # If we called -disolveToPoint:fraction: instead of -compositeToPoint:operation:, then the image
+    # could itself be drawn with less than full opaqueness, but since we're already setting the alpha
+    # on the entire window, we don't bother with that here.
+    image_to_draw = (window.alphaValue > 0.7) ? @circle_image : @penta_image
+    # same as `image_to_draw.compositeToPoint([0,0], operation:NSCompositeSourceOver)`
+    # apart that compositeToPoint usage is now discouraged as the behavior it provides is not recommended 
+    # for general use
+    image_to_draw.drawAtPoint([0,0], fromRect:frame, operation:NSCompositeSourceOver, fraction:1.0)
+    window.invalidateShadow
+  end
+  
+end
\ No newline at end of file


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/custom_view.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/custom_window.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/custom_window.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/custom_window.rb	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,69 @@
+# Description:  This is the implementation file for the CustomWindow class, which is our subclass of NSWindow.  We need to subclass
+#               NSWindow in order to configure the window properly in #initWithContentRect(contentRect, styleMask:aStyle, backing:bufferingType, defer:flag)
+#               to have a custom shape and be transparent.  We also override the #mouseDown and #mouseDragged metohds,
+#               to allow for dragging the window by clicking on its content area (since it doesn't have a title bar to drag).
+
+class CustomWindow < NSWindow
+  attr_accessor :initialLocation
+
+  # In Interface Builder we set CustomWindow to be the class for our window, so our own initializer is called here.
+  # the original method is being extended but still called thanks to the `super` call
+  def initWithContentRect(contentRect, styleMask:aStyle, backing:bufferingType, defer:flag)
+    # Call NSWindow's version of this function, but pass in the all-important value of NSBorderlessWindowMask
+    #for the styleMask so that the window doesn't have a title bar
+    result = super(contentRect, NSBorderlessWindowMask, NSBackingStoreBuffered, false)
+    # Set the background color to clear so that (along with the setOpaque call below) we can see through the parts
+    # of the window that we're not drawing into
+    result.setBackgroundColor(NSColor.clearColor)
+    # This next line pulls the window up to the front on top of other system windows.  This is how the Clock app behaves;
+    # generally you wouldn't do this for windows unless you really wanted them to float above everything.
+    result.setLevel(NSStatusWindowLevel)
+    # Let's start with no transparency for all drawing into the window
+    result.setAlphaValue(1.0)
+    # but let's turn off opaqueness so that we can see through the parts of the window that we're not drawing into
+    result.setOpaque(false)
+    # and while we're at it, make sure the window has a shadow, which will automatically be the shape of our custom content.
+    result.setHasShadow(true)
+    result
+  end
+
+  # Custom windows that use the NSBorderlessWindowMask can't become key by default.  Therefore, controls in such windows
+  # won't ever be enabled by default. Thus, we override this method to change that.
+  def canBecomeKeyWindow
+    true
+  end
+
+  # Once the user starts dragging the mouse, we move the window with it. We do this because the window has no title
+  # bar for the user to drag (so we have to implement dragging ourselves)
+  # (overriding original method)
+  def mouseDragged(theEvent)
+    screen_frame = NSScreen.mainScreen.frame
+    window_frame = self.frame
+    current_location = self.convertBaseToScreen(self.mouseLocationOutsideOfEventStream)
+
+    # grab the current global mouse location; we could just as easily get the mouse location 
+    # in the same way as we do in -mouseDown:
+    new_origin = NSPoint.new((current_location.x - @initialLocation.x), (current_location.y - @initialLocation.y))
+
+    # Don't let the window get dragged up under the menu bar
+    if((new_origin.y + window_frame.size.height) > (screen_frame.origin.y + screen_frame.size.height))
+      new_origin.y = screen_frame.origin.y + (screen_frame.size.height - window_frame.size.height)
+    end
+
+    # go ahead and move the window to the new location
+    self.setFrameOrigin(new_origin)
+  end
+
+  # We start tracking the a drag operation here when the user first clicks the mouse,
+  # to establish the initial location.
+  def mouseDown(theEvent)
+    window_frame = frame
+    
+    # grab the mouse location in global coordinates
+    @initialLocation = convertBaseToScreen(theEvent.locationInWindow)
+    @initialLocation.x -= window_frame.origin.x
+    @initialLocation.y -= window_frame.origin.y
+  end
+  
+  
+end
\ No newline at end of file


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/custom_window.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/menu.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/menu.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/menu.rb	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,32 @@
+module HotCocoa
+  def application_menu
+    menu do |main|
+      main.submenu :apple do |apple|
+        apple.item :about, :title => "About #{NSApp.name}"
+        apple.separator
+        apple.item :preferences, :key => ","
+        apple.separator
+        apple.submenu :services
+        apple.separator
+        apple.item :hide, :title => "Hide #{NSApp.name}", :key => "h"
+        apple.item :hide_others, :title => "Hide Others", :key => "h", :modifiers => [:command, :alt]
+        apple.item :show_all, :title => "Show All"
+        apple.separator
+        apple.item :quit, :title => "Quit #{NSApp.name}", :key => "q"
+      end
+      main.submenu :file do |file|
+        file.item :new, :key => "n"
+        file.item :open, :key => "o"
+      end
+      main.submenu :window do |win|
+        win.item :minimize, :key => "m"
+        win.item :zoom
+        win.separator
+        win.item :bring_all_to_front, :title => "Bring All to Front", :key => "o"
+      end
+      main.submenu :help do |help|
+        help.item :help, :title => "#{NSApp.name} Help"
+      end
+    end
+  end
+end


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/menu.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/nib_controller.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/nib_controller.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/nib_controller.rb	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,41 @@
+# Description:  This class loads the nib and implements the #changeTransparency
+#               action, called when the slider on the window is moved.
+
+class NibController < NSWindowController
+  attr_writer :itsWindow
+  
+  def init
+    # let's load the nib from our resources folder
+    initWithWindowNibName('MainMenu')
+    # let's load the window
+    window
+    NSLog('NibController initialized')
+    self
+  end
+
+  def windowDidLoad
+    NSLog('window loaded')
+  end
+  
+  # This method changes the transparency for the *entire window*, not some particular object.  Thus,
+  # all objects drawn in this window, even if drawn at full alpha value, will pick up this setting.
+  def changeTransparency(sender)
+    # set the window's alpha value from 0.0-1.0
+    @itsWindow.setAlphaValue(sender.floatValue)
+    # go ahead and tell the window to redraw things, which has the effect of calling CustomView's -drawRect: routine
+    @itsWindow.display
+  end
+  
+  def hideOtherApplications(sender)
+  end
+  
+  def unhideAllApplications(sender)
+  end
+  
+  def orderFrontStandardAboutPanel(sender)
+  end
+  
+  def hide(sender)
+  end
+  
+end
\ No newline at end of file


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/lib/nib_controller.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/HotCocoa.icns
===================================================================
(Binary files differ)


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/HotCocoa.icns
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/MainMenu.nib/designable.nib
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/MainMenu.nib/designable.nib	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/MainMenu.nib/designable.nib	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,1339 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
+	<data>
+		<int key="IBDocument.SystemTarget">1050</int>
+		<string key="IBDocument.SystemVersion">9G55</string>
+		<string key="IBDocument.InterfaceBuilderVersion">677</string>
+		<string key="IBDocument.AppKitVersion">949.43</string>
+		<string key="IBDocument.HIToolboxVersion">353.00</string>
+		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+		</object>
+		<object class="NSArray" key="IBDocument.PluginDependencies">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+		</object>
+		<object class="NSMutableDictionary" key="IBDocument.Metadata">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.RootObjects" id="189680405">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSCustomObject" id="794268641">
+				<object class="NSMutableString" key="NSClassName">
+					<characters key="NS.bytes">NSApplication</characters>
+				</object>
+			</object>
+			<object class="NSCustomObject" id="993996026">
+				<string key="NSClassName">FirstResponder</string>
+			</object>
+			<object class="NSCustomObject" id="1030453396">
+				<string key="NSClassName">NSApplication</string>
+			</object>
+			<object class="NSWindowTemplate" id="226667584">
+				<int key="NSWindowStyleMask">15</int>
+				<int key="NSWindowBacking">2</int>
+				<string key="NSWindowRect">{{434, 297}, {250, 250}}</string>
+				<int key="NSWTFlags">1886912512</int>
+				<string key="NSWindowTitle">The NSBorderlessWindowMask style makes this title bar go away</string>
+				<string key="NSWindowClass">CustomWindow</string>
+				<object class="NSMutableString" key="NSViewClass">
+					<characters key="NS.bytes">View</characters>
+				</object>
+				<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+				<string key="NSWindowContentMinSize">{142.233, 5}</string>
+				<object class="NSView" key="NSWindowView" id="742011431">
+					<nil key="NSNextResponder"/>
+					<int key="NSvFlags">256</int>
+					<object class="NSMutableArray" key="NSSubviews">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSCustomView" id="234282836">
+							<reference key="NSNextResponder" ref="742011431"/>
+							<int key="NSvFlags">301</int>
+							<string key="NSFrameSize">{250, 250}</string>
+							<reference key="NSSuperview" ref="742011431"/>
+							<string key="NSClassName">CustomView</string>
+							<string key="NSExtension">NSView</string>
+						</object>
+						<object class="NSTextField" id="856834491">
+							<reference key="NSNextResponder" ref="742011431"/>
+							<int key="NSvFlags">256</int>
+							<string key="NSFrame">{{-46, 116}, {351, 16}}</string>
+							<reference key="NSSuperview" ref="742011431"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSTextFieldCell" key="NSCell" id="904394513">
+								<int key="NSCellFlags">70385217</int>
+								<int key="NSCellFlags2">138413056</int>
+								<string key="NSContents">Move slider to change transparency</string>
+								<object class="NSFont" key="NSSupport">
+									<string key="NSName">LucidaGrande</string>
+									<double key="NSSize">1.100000e+01</double>
+									<int key="NSfFlags">2329</int>
+								</object>
+								<reference key="NSControlView" ref="856834491"/>
+								<object class="NSColor" key="NSBackgroundColor">
+									<int key="NSColorSpace">6</int>
+									<string key="NSCatalogName">System</string>
+									<string key="NSColorName">controlColor</string>
+									<object class="NSColor" key="NSColor">
+										<int key="NSColorSpace">3</int>
+										<bytes key="NSWhite">MC42NjY2NjY2OQA</bytes>
+									</object>
+								</object>
+								<object class="NSColor" key="NSTextColor">
+									<int key="NSColorSpace">6</int>
+									<string key="NSCatalogName">System</string>
+									<string key="NSColorName">controlTextColor</string>
+									<object class="NSColor" key="NSColor">
+										<int key="NSColorSpace">3</int>
+										<bytes key="NSWhite">MAA</bytes>
+									</object>
+								</object>
+							</object>
+						</object>
+						<object class="NSSlider" id="521930488">
+							<reference key="NSNextResponder" ref="742011431"/>
+							<int key="NSvFlags">290</int>
+							<string key="NSFrame">{{46, 84}, {157, 21}}</string>
+							<reference key="NSSuperview" ref="742011431"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSSliderCell" key="NSCell" id="846718754">
+								<int key="NSCellFlags">67501824</int>
+								<int key="NSCellFlags2">0</int>
+								<object class="NSMutableString" key="NSContents">
+									<characters key="NS.bytes"/>
+								</object>
+								<object class="NSFont" key="NSSupport">
+									<string key="NSName">Helvetica</string>
+									<double key="NSSize">1.200000e+01</double>
+									<int key="NSfFlags">16</int>
+								</object>
+								<reference key="NSControlView" ref="521930488"/>
+								<double key="NSMaxValue">1.000000e+00</double>
+								<double key="NSMinValue">0.000000e+00</double>
+								<double key="NSValue">1.000000e+00</double>
+								<double key="NSAltIncValue">0.000000e+00</double>
+								<int key="NSNumberOfTickMarks">0</int>
+								<int key="NSTickMarkPosition">0</int>
+								<bool key="NSAllowsTickMarkValuesOnly">NO</bool>
+								<bool key="NSVertical">NO</bool>
+							</object>
+						</object>
+					</object>
+					<string key="NSFrameSize">{250, 250}</string>
+				</object>
+				<string key="NSScreenRect">{{0, 4}, {1280, 998}}</string>
+				<string key="NSMinSize">{142.233, 27}</string>
+				<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+			</object>
+			<object class="NSMenu" id="427330406">
+				<string key="NSTitle">MainMenu</string>
+				<object class="NSMutableArray" key="NSMenuItems">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="NSMenuItem" id="26020946">
+						<reference key="NSMenu" ref="427330406"/>
+						<string key="NSTitle"/>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<object class="NSCustomResource" key="NSOnImage" id="620052169">
+							<string key="NSClassName">NSImage</string>
+							<string key="NSResourceName">NSMenuCheckmark</string>
+						</object>
+						<object class="NSCustomResource" key="NSMixedImage" id="714715107">
+							<string key="NSClassName">NSImage</string>
+							<string key="NSResourceName">NSMenuMixedState</string>
+						</object>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="368868106">
+							<object class="NSMutableString" key="NSTitle">
+								<characters key="NS.bytes">Info</characters>
+							</object>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="578000079">
+									<reference key="NSMenu" ref="368868106"/>
+									<string key="NSTitle">About RoundTransparentWindow</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="566075199">
+									<reference key="NSMenu" ref="368868106"/>
+									<string key="NSTitle">Preferences...</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="71150809">
+									<reference key="NSMenu" ref="368868106"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="525179015">
+									<reference key="NSMenu" ref="368868106"/>
+									<string key="NSTitle">Services</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+									<string key="NSAction">submenuAction:</string>
+									<object class="NSMenu" key="NSSubmenu" id="546457272">
+										<object class="NSMutableString" key="NSTitle">
+											<characters key="NS.bytes">Services</characters>
+										</object>
+										<object class="NSMutableArray" key="NSMenuItems">
+											<bool key="EncodedWithXMLCoder">YES</bool>
+										</object>
+										<string key="NSName">_NSServicesMenu</string>
+									</object>
+								</object>
+								<object class="NSMenuItem" id="884530387">
+									<reference key="NSMenu" ref="368868106"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="986833497">
+									<reference key="NSMenu" ref="368868106"/>
+									<string key="NSTitle">Hide MyApp</string>
+									<string key="NSKeyEquiv">h</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="778480919">
+									<reference key="NSMenu" ref="368868106"/>
+									<string key="NSTitle">Hide Others</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="836091824">
+									<reference key="NSMenu" ref="368868106"/>
+									<string key="NSTitle">Show All</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="12353408">
+									<reference key="NSMenu" ref="368868106"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="94081393">
+									<reference key="NSMenu" ref="368868106"/>
+									<string key="NSTitle">Quit MyApp</string>
+									<string key="NSKeyEquiv">q</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+							</object>
+							<string key="NSName">_NSAppleMenu</string>
+						</object>
+					</object>
+					<object class="NSMenuItem" id="49122607">
+						<reference key="NSMenu" ref="427330406"/>
+						<string key="NSTitle">File</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="620052169"/>
+						<reference key="NSMixedImage" ref="714715107"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="373044874">
+							<object class="NSMutableString" key="NSTitle">
+								<characters key="NS.bytes">File</characters>
+							</object>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="82327060">
+									<reference key="NSMenu" ref="373044874"/>
+									<string key="NSTitle">Close</string>
+									<string key="NSKeyEquiv">w</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="468880816">
+									<reference key="NSMenu" ref="373044874"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="534104864">
+									<reference key="NSMenu" ref="373044874"/>
+									<string key="NSTitle">Page Setup...</string>
+									<string key="NSKeyEquiv">P</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="813382576">
+									<reference key="NSMenu" ref="373044874"/>
+									<string key="NSTitle">Print...</string>
+									<string key="NSKeyEquiv">p</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+							</object>
+						</object>
+					</object>
+					<object class="NSMenuItem" id="607326710">
+						<reference key="NSMenu" ref="427330406"/>
+						<string key="NSTitle">Edit</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="620052169"/>
+						<reference key="NSMixedImage" ref="714715107"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="100018730">
+							<object class="NSMutableString" key="NSTitle">
+								<characters key="NS.bytes">Edit</characters>
+							</object>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="145924008">
+									<reference key="NSMenu" ref="100018730"/>
+									<string key="NSTitle">Undo</string>
+									<string key="NSKeyEquiv">z</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="586571673">
+									<reference key="NSMenu" ref="100018730"/>
+									<string key="NSTitle">Redo</string>
+									<string key="NSKeyEquiv">Z</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="264637218">
+									<reference key="NSMenu" ref="100018730"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="238617272">
+									<reference key="NSMenu" ref="100018730"/>
+									<string key="NSTitle">Cut</string>
+									<string key="NSKeyEquiv">x</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="823795642">
+									<reference key="NSMenu" ref="100018730"/>
+									<string key="NSTitle">Copy</string>
+									<string key="NSKeyEquiv">c</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="731934151">
+									<reference key="NSMenu" ref="100018730"/>
+									<string key="NSTitle">Paste</string>
+									<string key="NSKeyEquiv">v</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="976549440">
+									<reference key="NSMenu" ref="100018730"/>
+									<string key="NSTitle">Delete</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="880255416">
+									<reference key="NSMenu" ref="100018730"/>
+									<string key="NSTitle">Select All</string>
+									<string key="NSKeyEquiv">a</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+							</object>
+						</object>
+					</object>
+					<object class="NSMenuItem" id="946734486">
+						<reference key="NSMenu" ref="427330406"/>
+						<string key="NSTitle">Window</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="620052169"/>
+						<reference key="NSMixedImage" ref="714715107"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="195370256">
+							<object class="NSMutableString" key="NSTitle">
+								<characters key="NS.bytes">Window</characters>
+							</object>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="213179981">
+									<reference key="NSMenu" ref="195370256"/>
+									<string key="NSTitle">Minimize Window</string>
+									<string key="NSKeyEquiv">m</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="485846999">
+									<reference key="NSMenu" ref="195370256"/>
+									<string key="NSTitle">Zoom Window</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="872917249">
+									<reference key="NSMenu" ref="195370256"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+								<object class="NSMenuItem" id="40897183">
+									<reference key="NSMenu" ref="195370256"/>
+									<string key="NSTitle">Arrange in Front</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+							</object>
+							<string key="NSName">_NSWindowsMenu</string>
+						</object>
+					</object>
+					<object class="NSMenuItem" id="866988687">
+						<reference key="NSMenu" ref="427330406"/>
+						<string key="NSTitle">Help</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="620052169"/>
+						<reference key="NSMixedImage" ref="714715107"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="515537722">
+							<object class="NSMutableString" key="NSTitle">
+								<characters key="NS.bytes">Help</characters>
+							</object>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="532003159">
+									<reference key="NSMenu" ref="515537722"/>
+									<string key="NSTitle">RoundTransparentWindow Help</string>
+									<string key="NSKeyEquiv">?</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="620052169"/>
+									<reference key="NSMixedImage" ref="714715107"/>
+								</object>
+							</object>
+						</object>
+					</object>
+				</object>
+				<string key="NSName">_NSMainMenu</string>
+			</object>
+			<object class="NSCustomObject" id="939158553">
+				<string key="NSClassName">NSObject</string>
+			</object>
+			<object class="NSObjectController" id="10383395">
+				<bool key="NSEditable">YES</bool>
+				<object class="_NSManagedProxy" key="_NSManagedProxy"/>
+			</object>
+		</object>
+		<object class="IBObjectContainer" key="IBDocument.Objects">
+			<object class="NSMutableArray" key="connectionRecords">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">cut:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="238617272"/>
+					</object>
+					<int key="connectionID">30</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">copy:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="823795642"/>
+					</object>
+					<int key="connectionID">31</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">paste:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="731934151"/>
+					</object>
+					<int key="connectionID">32</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">selectAll:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="880255416"/>
+					</object>
+					<int key="connectionID">33</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">performMiniaturize:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="213179981"/>
+					</object>
+					<int key="connectionID">37</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">arrangeInFront:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="40897183"/>
+					</object>
+					<int key="connectionID">39</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">print:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="813382576"/>
+					</object>
+					<int key="connectionID">86</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">runPageLayout:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="534104864"/>
+					</object>
+					<int key="connectionID">87</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">clear:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="976549440"/>
+					</object>
+					<int key="connectionID">91</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">undo:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="145924008"/>
+					</object>
+					<int key="connectionID">118</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">redo:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="586571673"/>
+					</object>
+					<int key="connectionID">119</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">showHelp:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="532003159"/>
+					</object>
+					<int key="connectionID">122</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">performZoom:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="485846999"/>
+					</object>
+					<int key="connectionID">123</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">orderFrontStandardAboutPanel:</string>
+						<reference key="source" ref="794268641"/>
+						<reference key="destination" ref="578000079"/>
+					</object>
+					<int key="connectionID">124</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">hide:</string>
+						<reference key="source" ref="794268641"/>
+						<reference key="destination" ref="986833497"/>
+					</object>
+					<int key="connectionID">130</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">terminate:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="94081393"/>
+					</object>
+					<int key="connectionID">133</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">performClose:</string>
+						<reference key="source" ref="993996026"/>
+						<reference key="destination" ref="82327060"/>
+					</object>
+					<int key="connectionID">135</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">hideOtherApplications:</string>
+						<reference key="source" ref="794268641"/>
+						<reference key="destination" ref="778480919"/>
+					</object>
+					<int key="connectionID">142</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">unhideAllApplications:</string>
+						<reference key="source" ref="794268641"/>
+						<reference key="destination" ref="836091824"/>
+					</object>
+					<int key="connectionID">143</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">itsWindow</string>
+						<reference key="source" ref="939158553"/>
+						<reference key="destination" ref="226667584"/>
+					</object>
+					<int key="connectionID">145</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">itsWindow</string>
+						<reference key="source" ref="10383395"/>
+						<reference key="destination" ref="226667584"/>
+					</object>
+					<int key="connectionID">154</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">changeTransparency:</string>
+						<reference key="source" ref="10383395"/>
+						<reference key="destination" ref="521930488"/>
+					</object>
+					<int key="connectionID">155</int>
+				</object>
+			</object>
+			<object class="IBMutableOrderedSet" key="objectRecords">
+				<object class="NSArray" key="orderedObjects">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBObjectRecord">
+						<int key="objectID">0</int>
+						<object class="NSArray" key="object" id="0">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+						</object>
+						<reference key="children" ref="189680405"/>
+						<nil key="parent"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-2</int>
+						<reference key="object" ref="794268641"/>
+						<reference key="parent" ref="0"/>
+						<string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-1</int>
+						<reference key="object" ref="993996026"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">First Responder</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">21</int>
+						<reference key="object" ref="226667584"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="742011431"/>
+						</object>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">MyWindow</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">2</int>
+						<reference key="object" ref="742011431"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="521930488"/>
+							<reference ref="856834491"/>
+							<reference ref="234282836"/>
+						</object>
+						<reference key="parent" ref="226667584"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">146</int>
+						<reference key="object" ref="521930488"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="846718754"/>
+						</object>
+						<reference key="parent" ref="742011431"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">147</int>
+						<reference key="object" ref="856834491"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="904394513"/>
+						</object>
+						<reference key="parent" ref="742011431"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">149</int>
+						<reference key="object" ref="234282836"/>
+						<reference key="parent" ref="742011431"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">29</int>
+						<reference key="object" ref="427330406"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="607326710"/>
+							<reference ref="946734486"/>
+							<reference ref="26020946"/>
+							<reference ref="49122607"/>
+							<reference ref="866988687"/>
+						</object>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">MainMenu</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">15</int>
+						<reference key="object" ref="607326710"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="100018730"/>
+						</object>
+						<reference key="parent" ref="427330406"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">13</int>
+						<reference key="object" ref="100018730"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="823795642"/>
+							<reference ref="731934151"/>
+							<reference ref="880255416"/>
+							<reference ref="238617272"/>
+							<reference ref="976549440"/>
+							<reference ref="145924008"/>
+							<reference ref="586571673"/>
+							<reference ref="264637218"/>
+						</object>
+						<reference key="parent" ref="607326710"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">4</int>
+						<reference key="object" ref="823795642"/>
+						<reference key="parent" ref="100018730"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">8</int>
+						<reference key="object" ref="731934151"/>
+						<reference key="parent" ref="100018730"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">11</int>
+						<reference key="object" ref="880255416"/>
+						<reference key="parent" ref="100018730"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">22</int>
+						<reference key="object" ref="238617272"/>
+						<reference key="parent" ref="100018730"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">90</int>
+						<reference key="object" ref="976549440"/>
+						<reference key="parent" ref="100018730"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">115</int>
+						<reference key="object" ref="145924008"/>
+						<reference key="parent" ref="100018730"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">116</int>
+						<reference key="object" ref="586571673"/>
+						<reference key="parent" ref="100018730"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">117</int>
+						<reference key="object" ref="264637218"/>
+						<reference key="parent" ref="100018730"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">19</int>
+						<reference key="object" ref="946734486"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="195370256"/>
+						</object>
+						<reference key="parent" ref="427330406"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">24</int>
+						<reference key="object" ref="195370256"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="40897183"/>
+							<reference ref="213179981"/>
+							<reference ref="872917249"/>
+							<reference ref="485846999"/>
+						</object>
+						<reference key="parent" ref="946734486"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">5</int>
+						<reference key="object" ref="40897183"/>
+						<reference key="parent" ref="195370256"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">23</int>
+						<reference key="object" ref="213179981"/>
+						<reference key="parent" ref="195370256"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">92</int>
+						<reference key="object" ref="872917249"/>
+						<reference key="parent" ref="195370256"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">120</int>
+						<reference key="object" ref="485846999"/>
+						<reference key="parent" ref="195370256"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">56</int>
+						<reference key="object" ref="26020946"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="368868106"/>
+						</object>
+						<reference key="parent" ref="427330406"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">57</int>
+						<reference key="object" ref="368868106"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="578000079"/>
+							<reference ref="525179015"/>
+							<reference ref="71150809"/>
+							<reference ref="12353408"/>
+							<reference ref="986833497"/>
+							<reference ref="566075199"/>
+							<reference ref="94081393"/>
+							<reference ref="884530387"/>
+							<reference ref="778480919"/>
+							<reference ref="836091824"/>
+						</object>
+						<reference key="parent" ref="26020946"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">58</int>
+						<reference key="object" ref="578000079"/>
+						<reference key="parent" ref="368868106"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">125</int>
+						<reference key="object" ref="525179015"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="546457272"/>
+						</object>
+						<reference key="parent" ref="368868106"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">126</int>
+						<reference key="object" ref="546457272"/>
+						<reference key="parent" ref="525179015"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">127</int>
+						<reference key="object" ref="71150809"/>
+						<reference key="parent" ref="368868106"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">128</int>
+						<reference key="object" ref="12353408"/>
+						<reference key="parent" ref="368868106"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">129</int>
+						<reference key="object" ref="986833497"/>
+						<reference key="parent" ref="368868106"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">131</int>
+						<reference key="object" ref="566075199"/>
+						<reference key="parent" ref="368868106"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">132</int>
+						<reference key="object" ref="94081393"/>
+						<reference key="parent" ref="368868106"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">137</int>
+						<reference key="object" ref="884530387"/>
+						<reference key="parent" ref="368868106"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">140</int>
+						<reference key="object" ref="778480919"/>
+						<reference key="parent" ref="368868106"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">141</int>
+						<reference key="object" ref="836091824"/>
+						<reference key="parent" ref="368868106"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">83</int>
+						<reference key="object" ref="49122607"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="373044874"/>
+						</object>
+						<reference key="parent" ref="427330406"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">81</int>
+						<reference key="object" ref="373044874"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="534104864"/>
+							<reference ref="813382576"/>
+							<reference ref="82327060"/>
+							<reference ref="468880816"/>
+						</object>
+						<reference key="parent" ref="49122607"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">77</int>
+						<reference key="object" ref="534104864"/>
+						<reference key="parent" ref="373044874"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">78</int>
+						<reference key="object" ref="813382576"/>
+						<reference key="parent" ref="373044874"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">134</int>
+						<reference key="object" ref="82327060"/>
+						<reference key="parent" ref="373044874"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">136</int>
+						<reference key="object" ref="468880816"/>
+						<reference key="parent" ref="373044874"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">103</int>
+						<reference key="object" ref="866988687"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="515537722"/>
+						</object>
+						<reference key="parent" ref="427330406"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">106</int>
+						<reference key="object" ref="515537722"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="532003159"/>
+						</object>
+						<reference key="parent" ref="866988687"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">111</int>
+						<reference key="object" ref="532003159"/>
+						<reference key="parent" ref="515537722"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">144</int>
+						<reference key="object" ref="939158553"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">Controller</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">151</int>
+						<reference key="object" ref="846718754"/>
+						<reference key="parent" ref="521930488"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">152</int>
+						<reference key="object" ref="904394513"/>
+						<reference key="parent" ref="856834491"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-3</int>
+						<reference key="object" ref="1030453396"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">Application</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">153</int>
+						<reference key="object" ref="10383395"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">nib_controller</string>
+					</object>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="flattenedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="NSMutableArray" key="dict.sortedKeys">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>-1.IBPluginDependency</string>
+					<string>-2.IBPluginDependency</string>
+					<string>-3.IBPluginDependency</string>
+					<string>103.IBPluginDependency</string>
+					<string>103.ImportedFromIB2</string>
+					<string>106.IBPluginDependency</string>
+					<string>106.ImportedFromIB2</string>
+					<string>11.IBPluginDependency</string>
+					<string>11.ImportedFromIB2</string>
+					<string>111.IBPluginDependency</string>
+					<string>111.ImportedFromIB2</string>
+					<string>115.IBPluginDependency</string>
+					<string>115.ImportedFromIB2</string>
+					<string>116.IBPluginDependency</string>
+					<string>116.ImportedFromIB2</string>
+					<string>117.IBPluginDependency</string>
+					<string>117.ImportedFromIB2</string>
+					<string>120.IBPluginDependency</string>
+					<string>120.ImportedFromIB2</string>
+					<string>125.IBPluginDependency</string>
+					<string>125.ImportedFromIB2</string>
+					<string>126.IBPluginDependency</string>
+					<string>126.ImportedFromIB2</string>
+					<string>127.IBPluginDependency</string>
+					<string>127.ImportedFromIB2</string>
+					<string>128.IBPluginDependency</string>
+					<string>128.ImportedFromIB2</string>
+					<string>129.IBPluginDependency</string>
+					<string>129.ImportedFromIB2</string>
+					<string>13.IBPluginDependency</string>
+					<string>13.ImportedFromIB2</string>
+					<string>131.IBPluginDependency</string>
+					<string>131.ImportedFromIB2</string>
+					<string>132.IBPluginDependency</string>
+					<string>132.ImportedFromIB2</string>
+					<string>134.IBPluginDependency</string>
+					<string>134.ImportedFromIB2</string>
+					<string>136.IBPluginDependency</string>
+					<string>136.ImportedFromIB2</string>
+					<string>137.IBPluginDependency</string>
+					<string>137.ImportedFromIB2</string>
+					<string>140.IBPluginDependency</string>
+					<string>140.ImportedFromIB2</string>
+					<string>141.IBPluginDependency</string>
+					<string>141.ImportedFromIB2</string>
+					<string>144.IBPluginDependency</string>
+					<string>144.ImportedFromIB2</string>
+					<string>146.IBPluginDependency</string>
+					<string>146.ImportedFromIB2</string>
+					<string>147.IBPluginDependency</string>
+					<string>147.ImportedFromIB2</string>
+					<string>149.IBPluginDependency</string>
+					<string>149.ImportedFromIB2</string>
+					<string>15.IBPluginDependency</string>
+					<string>15.ImportedFromIB2</string>
+					<string>151.IBPluginDependency</string>
+					<string>152.IBPluginDependency</string>
+					<string>153.CustomClassName</string>
+					<string>153.IBPluginDependency</string>
+					<string>19.IBPluginDependency</string>
+					<string>19.ImportedFromIB2</string>
+					<string>2.IBPluginDependency</string>
+					<string>2.ImportedFromIB2</string>
+					<string>21.IBEditorWindowLastContentRect</string>
+					<string>21.IBWindowTemplateEditedContentRect</string>
+					<string>21.ImportedFromIB2</string>
+					<string>21.NSWindowTemplate.visibleAtLaunch</string>
+					<string>21.windowTemplate.hasMinSize</string>
+					<string>21.windowTemplate.minSize</string>
+					<string>22.IBPluginDependency</string>
+					<string>22.ImportedFromIB2</string>
+					<string>23.IBPluginDependency</string>
+					<string>23.ImportedFromIB2</string>
+					<string>24.IBPluginDependency</string>
+					<string>24.ImportedFromIB2</string>
+					<string>29.IBPluginDependency</string>
+					<string>29.ImportedFromIB2</string>
+					<string>4.IBPluginDependency</string>
+					<string>4.ImportedFromIB2</string>
+					<string>5.IBPluginDependency</string>
+					<string>5.ImportedFromIB2</string>
+					<string>56.IBPluginDependency</string>
+					<string>56.ImportedFromIB2</string>
+					<string>57.IBPluginDependency</string>
+					<string>57.ImportedFromIB2</string>
+					<string>58.IBPluginDependency</string>
+					<string>58.ImportedFromIB2</string>
+					<string>77.IBPluginDependency</string>
+					<string>77.ImportedFromIB2</string>
+					<string>78.IBPluginDependency</string>
+					<string>78.ImportedFromIB2</string>
+					<string>8.IBPluginDependency</string>
+					<string>8.ImportedFromIB2</string>
+					<string>81.IBPluginDependency</string>
+					<string>81.ImportedFromIB2</string>
+					<string>83.IBPluginDependency</string>
+					<string>83.ImportedFromIB2</string>
+					<string>90.IBPluginDependency</string>
+					<string>90.ImportedFromIB2</string>
+					<string>92.IBPluginDependency</string>
+					<string>92.ImportedFromIB2</string>
+				</object>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<boolean value="YES" id="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>NibController</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>{{50, 495}, {250, 250}}</string>
+					<string>{{50, 495}, {250, 250}}</string>
+					<reference ref="5"/>
+					<reference ref="5"/>
+					<reference ref="5"/>
+					<string>{142.233, 5}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<reference ref="5"/>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="unlocalizedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="NSArray" key="dict.sortedKeys">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="activeLocalization"/>
+			<object class="NSMutableDictionary" key="localizations">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="NSArray" key="dict.sortedKeys">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="sourceID"/>
+			<int key="maxID">155</int>
+		</object>
+		<object class="IBClassDescriber" key="IBDocument.Classes">
+			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBPartialClassDescription">
+					<string key="className">CustomView</string>
+					<string key="superclassName">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBUserSource</string>
+						<string key="minorKey"/>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">CustomWindow</string>
+					<string key="superclassName">NSWindow</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBUserSource</string>
+						<string key="minorKey"/>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">FirstResponder</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBUserSource</string>
+						<string key="minorKey"/>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NibController</string>
+					<object class="NSMutableDictionary" key="actions">
+						<string key="NS.key.0">changeTransparency:</string>
+						<string key="NS.object.0">id</string>
+					</object>
+					<object class="NSMutableDictionary" key="outlets">
+						<string key="NS.key.0">itsWindow</string>
+						<string key="NS.object.0">id</string>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBUserSource</string>
+						<string key="minorKey"/>
+					</object>
+				</object>
+			</object>
+		</object>
+		<int key="IBDocument.localizationMode">0</int>
+		<nil key="IBDocument.LastKnownRelativeProjectPath"/>
+		<int key="IBDocument.defaultPropertyAccessControl">3</int>
+	</data>
+</archive>


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/MainMenu.nib/designable.nib
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/MainMenu.nib/keyedobjects.nib
===================================================================
(Binary files differ)


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/MainMenu.nib/keyedobjects.nib
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/circle.tif
===================================================================
(Binary files differ)


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/circle.tif
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/pentagram.tif
===================================================================
(Binary files differ)


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window/resources/pentagram.tif
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/Rakefile
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/Rakefile	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/Rakefile	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,4 @@
+require 'hotcocoa/application_builder'
+require 'hotcocoa/standard_rake_tasks'
+
+task :default => [:run]
\ No newline at end of file


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/Rakefile
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/config/build.yml
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/config/build.yml	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/config/build.yml	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,8 @@
+name: Round Transparent Window
+load: lib/application.rb
+version: "1.0"
+icon: resources/HotCocoa.icns
+resources:
+  - resources/**/*.*
+sources: 
+  - lib/**/*.rb


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/config/build.yml
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/application.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/application.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/application.rb	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,76 @@
+require 'hotcocoa'
+SOURCE_DIR = File.expand_path(File.dirname(__FILE__))
+require SOURCE_DIR + '/controller'
+require SOURCE_DIR + '/custom_view_behaviors'
+require SOURCE_DIR + '/custom_window_behaviors'
+
+class Application
+  include HotCocoa
+  
+  def start
+    application :name => "HotCocoa: Round Transparent Window" do |app|
+      app.delegate = self
+      @main_window = window :frame => [434, 297, 250, 250],
+                            :title => "The NSBorderlessWindowMask style makes this title bar go away",
+                            :style => [:borderless] do |win|
+        win.setBackgroundColor(color(:name => 'clear'))
+        # This next line pulls the window up to the front on top of other system windows.  This is how the Clock app behaves;
+        # generally you wouldn't do this for windows unless you really wanted them to float above everything.
+        win.level = NSStatusWindowLevel
+        # Let's start with no transparency for all drawing into the window
+        win.alphaValue = 1.0
+        # but let's turn off opaqueness so that we can see through the parts of the window that we're not drawing into
+        win.opaque = false
+        # and while we're at it, make sure the window has a shadow, which will automatically be the shape of our custom content.
+        win.hasShadow = true
+        # We need to extend the window to add support for mouse dragging
+        win.extend(CustomWindowBehaviors)
+        # and we need to extend the window's content view to override the drawRect method
+        win.contentView.extend(CustomViewBehaviors)
+        win << slider_layout("Move slider to change transparency") do |slider|
+            # set the window's alpha value from 0.0-1.0
+            win.alphaValue = slider.floatValue
+            # go ahead and tell the window to redraw things, which has the effect of calling win.contentView's -drawRect: routine
+            win.display
+        end
+      end
+    end
+  end
+  
+  def slider_layout(label, &block)
+    layout_view(:frame => [0, 0, 0, 90], :layout => {:expand => [:height, :width], :start => false}) do |view|
+      view << label(:text => label, :layout => {:align => :center})
+      s = slider :min => 0, :max => 1.0, :on_action => block, :layout => {:expand => :width, :align => :top}
+      s.floatValue = 1.0
+      s.frameSize  = [0, 24]
+      view << s
+    end
+  end
+  
+  # file/open
+  def on_open(menu)
+  end
+  
+  # file/new 
+  def on_new(menu)
+  end
+  
+  # help menu item
+  def on_help(menu)
+  end
+  
+  # This is commented out, so the minimize menu item is disabled
+  #def on_minimize(menu)
+  #end
+  
+  # window/zoom
+  def on_zoom(menu)
+  end
+  
+  # window/bring_all_to_front
+  def on_bring_all_to_front(menu)
+  end
+  
+end
+
+Application.new.start
\ No newline at end of file


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/application.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/custom_view_behaviors.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/custom_view_behaviors.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/custom_view_behaviors.rb	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,40 @@
+# Description: 	This is the header file for the CustomView class, which handles the drawing of the window content.
+#               we use a circle graphic and a pentagram graphic, switching between the two depending upon the 
+#               window's transparency.
+
+module CustomViewBehaviors
+
+  def set_images
+    @circle_image = NSImage.imageNamed("circle")
+    @penta_image  = NSImage.imageNamed("pentagram")
+  end
+  
+  def redraw
+    needsDisplay = true
+  end
+  
+  # When it's time to draw, this method is called.
+  # This view is inside the window, the window's opaqueness has been turned off,
+  # and the window's styleMask has been set to NSBorderlessWindowMask on creation,
+  # so what this view draws *is all the user sees of the window*.  The first two lines below
+  # then fill things with "clear" color, so that any images we draw are the custom shape of the window,
+  # for all practical purposes.  Furthermore, if the window's alphaValue is <1.0, drawing will use
+  # transparency.
+  def drawRect(rect)
+    set_images unless @circle_image
+    # erase whatever graphics were there before with clear
+    NSColor.clearColor.set
+    NSRectFill(frame)   
+    # if our window transparency is >0.7, we decide to draw the circle.  Otherwise, draw the pentagram.
+    # If we called -disolveToPoint:fraction: instead of -compositeToPoint:operation:, then the image
+    # could itself be drawn with less than full opaqueness, but since we're already setting the alpha
+    # on the entire window, we don't bother with that here.
+    image_to_draw = (window.alphaValue > 0.7) ? @circle_image : @penta_image
+    # same as `image_to_draw.compositeToPoint([0,0], operation:NSCompositeSourceOver)`
+    # apart that compositeToPoint usage is now discouraged as the behavior it provides is not recommended 
+    # for general use
+    image_to_draw.drawAtPoint([0,0], fromRect:frame, operation:NSCompositeSourceOver, fraction:1.0)
+    window.invalidateShadow
+  end
+  
+end
\ No newline at end of file


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/custom_view_behaviors.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/custom_window_behaviors.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/custom_window_behaviors.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/custom_window_behaviors.rb	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,67 @@
+# Description:  This is where we extend the windows behaviors to have a custom shape and be transparent.  
+#               We also override the #mouseDown and #mouseDragged methods, to allow for dragging the window
+#               by clicking on its content area (since it doesn't have a title bar to drag).
+
+module CustomWindowBehaviors
+  attr_accessor :initialLocation
+
+  # We are extending initWithContentRect which is called by #window
+  def initWithContentRect(contentRect, styleMask:aStyle, backing:bufferingType, defer:flag)
+    # Call NSWindow's version of this function, but pass in the all-important value of NSBorderlessWindowMask
+    #for the styleMask so that the window doesn't have a title bar
+    result = super(contentRect, NSBorderlessWindowMask, NSBackingStoreBuffered, false)
+    # Set the background color to clear so that (along with the setOpaque call below) we can see through the parts
+    # of the window that we're not drawing into
+    result.backgroundColor = color(:name => 'clear')
+    # This next line pulls the window up to the front on top of other system windows.  This is how the Clock app behaves;
+    # generally you wouldn't do this for windows unless you really wanted them to float above everything.
+    result.level = NSStatusWindowLevel
+    # Let's start with no transparency for all drawing into the window
+    result.alphaValue = 1.0
+    # but let's turn off opaqueness so that we can see through the parts of the window that we're not drawing into
+    result.opaque = false
+    # and while we're at it, make sure the window has a shadow, which will automatically be the shape of our custom content.
+    result.hasShadow = true
+    result
+  end
+
+  # Custom windows that use the NSBorderlessWindowMask can't become key by default.  Therefore, controls in such windows
+  # won't ever be enabled by default. Thus, we override this method to change that.
+  def canBecomeKeyWindow
+    true
+  end
+
+  # Once the user starts dragging the mouse, we move the window with it. We do this because the window has no title
+  # bar for the user to drag (so we have to implement dragging ourselves)
+  # (overriding original method)
+  def mouseDragged(theEvent)
+    screen_frame = NSScreen.mainScreen.frame
+    window_frame = self.frame
+    current_location = self.convertBaseToScreen(self.mouseLocationOutsideOfEventStream)
+
+    # grab the current global mouse location; we could just as easily get the mouse location 
+    # in the same way as we do in -mouseDown:
+    new_origin = NSPoint.new((current_location.x - @initialLocation.x), (current_location.y - @initialLocation.y))
+
+    # Don't let the window get dragged up under the menu bar
+    if((new_origin.y + window_frame.size.height) > (screen_frame.origin.y + screen_frame.size.height))
+      new_origin.y = screen_frame.origin.y + (screen_frame.size.height - window_frame.size.height)
+    end
+
+    # go ahead and move the window to the new location
+    self.frameOrigin = new_origin
+  end
+
+  # We start tracking the a drag operation here when the user first clicks the mouse,
+  # to establish the initial location.
+  def mouseDown(theEvent)
+    window_frame = frame
+    
+    # grab the mouse location in global coordinates
+    @initialLocation = convertBaseToScreen(theEvent.locationInWindow)
+    @initialLocation.x -= window_frame.origin.x
+    @initialLocation.y -= window_frame.origin.y
+  end
+  
+  
+end
\ No newline at end of file


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/custom_window_behaviors.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/menu.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/menu.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/menu.rb	2009-03-07 05:16:43 UTC (rev 845)
@@ -0,0 +1,32 @@
+module HotCocoa
+  def application_menu
+    menu do |main|
+      main.submenu :apple do |apple|
+        apple.item :about, :title => "About #{NSApp.name}"
+        apple.separator
+        apple.item :preferences, :key => ","
+        apple.separator
+        apple.submenu :services
+        apple.separator
+        apple.item :hide, :title => "Hide #{NSApp.name}", :key => "h"
+        apple.item :hide_others, :title => "Hide Others", :key => "h", :modifiers => [:command, :alt]
+        apple.item :show_all, :title => "Show All"
+        apple.separator
+        apple.item :quit, :title => "Quit #{NSApp.name}", :key => "q"
+      end
+      main.submenu :file do |file|
+        file.item :new, :key => "n"
+        file.item :open, :key => "o"
+      end
+      main.submenu :window do |win|
+        win.item :minimize, :key => "m"
+        win.item :zoom
+        win.separator
+        win.item :bring_all_to_front, :title => "Bring All to Front", :key => "o"
+      end
+      main.submenu :help do |help|
+        help.item :help, :title => "#{NSApp.name} Help"
+      end
+    end
+  end
+end


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/lib/menu.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/resources/HotCocoa.icns
===================================================================
(Binary files differ)


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/resources/HotCocoa.icns
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/resources/circle.tif
===================================================================
(Binary files differ)


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/resources/circle.tif
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/resources/pentagram.tif
===================================================================
(Binary files differ)


Property changes on: MacRuby/trunk/sample-macruby/HotCocoa/round_transparent_window_no_nibs/resources/pentagram.tif
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090306/f9ffa200/attachment-0001.html>


More information about the macruby-changes mailing list