【发布时间】:2018-06-25 13:24:20
【问题描述】:
【问题讨论】:
标签: java swt jruby shoes shoes-4
【问题讨论】:
标签: java swt jruby shoes shoes-4
我是这样实现的:
我将此代码放在我的 Shoes.app 声明之前
class Shoes
module Swt
class App
def initialize_shell
@image = ::Swt::Graphics::Image.new(::Swt.display, ICON)
@shell = ::Swt::Widgets::Shell.new(::Swt.display, main_window_style)
@shell.image = @image
@shell.text = @dsl.app_title
@shell.background_mode = ::Swt::SWT::INHERIT_DEFAULT
@shell.background = @background.real
full_size_byte_mask = 32768
hack_cocoa_main_window('setTitleVisibility:', 1)
hack_cocoa_main_window('setStyleMask:', @shell.view.window.styleMask | full_size_byte_mask)
hack_cocoa_main_window('setTitlebarAppearsTransparent:', 1)
end
private
def hack_cocoa_main_window(key, value, type=nil)
key = org.eclipse.swt.internal.cocoa::OS.sel_registerName(key)
id = @shell.view.window.id
msg_method = ['objc_msgSend', type].compact.join('_')
org.eclipse.swt.internal.cocoa::OS.send(msg_method, id, key, value)
end
end
end
end
【讨论】: