Skip to content

Commit

Permalink
add frame color support and size= methods TICKET #259, #261
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@1597 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information
richkilmer committed May 26, 2009
1 parent 04f8759 commit e737182
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/hotcocoa/layout_view.rb
Expand Up @@ -221,6 +221,8 @@ def in_layout_view?

class LayoutView < NSView

attr_accessor :frame_color

def initWithFrame(frame)
super
@mode = :vertical
Expand Down Expand Up @@ -272,6 +274,10 @@ def frame=(frame)
setFrame(frame)
end

def size=(size)
setFrameSize(size)
end

def margin
@margin
end
Expand Down Expand Up @@ -318,12 +324,12 @@ def remove_all_views
relayout!
end

if $DEBUG
def drawRect(frame)
NSColor.redColor.set
NSFrameRect(frame)
def drawRect(frame)
if @frame_color
@frame_color.set
NSFrameRect(frame)
end
end
end

def setFrame(frame)
super
Expand Down

0 comments on commit e737182

Please sign in to comment.