Class: Opine::Dark::Window

Inherits:
Native::Window show all
Defined in:
lib/opine/widgets/window_dark_osx.rb

Defined Under Namespace

Classes: TitleView

Constant Summary

Constants inherited from Window

Window::DEFAULTS

Instance Attribute Summary

Attributes inherited from Window

#content_view, #frame, #title, #window

Instance Method Summary collapse

Methods inherited from Native::Window

#title=, #visible?

Methods inherited from Window

#table

Constructor Details

#initialize(options, &block) ⇒ Window

Returns a new instance of Window.



91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/opine/widgets/window_dark_osx.rb', line 91

def initialize(options,&block)
  super do |win|
    win.window.setOpaque false
    win.window.setHasShadow true

    view = TitleView.alloc.initWithFrame NSRect.new(x: frame.x, y: frame.height-22, width: frame.width, height: 22)
    window.contentView.addSubview view
    view.setAutoresizingMask(NSViewWidthSizable | NSViewHeightSizable)

    instance_eval(&block) if block
  end
end

Instance Method Details

#native_styleObject



104
105
106
# File 'lib/opine/widgets/window_dark_osx.rb', line 104

def native_style
  NSResizableWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask
end