Sha256: 07c4c8a8d36ac0bc306e469fc37f21de3f30b754a2c168a3a9e8e6d28702df3b
Contents?: true
Size: 841 Bytes
Versions: 3
Compression:
Stored size: 841 Bytes
Contents
require_relative '../../command_handler' require_relative '../g_color' module Glimmer module SWT module CommandHandlers class ColorCommandHandler include CommandHandler include_package 'org.eclipse.swt.widgets' def can_handle?(parent, command_symbol, *args, &block) ['rgba', 'rgb'].include?(command_symbol.to_s) and (3..5).include?(args.count) end def do_handle(parent, command_symbol, *args, &block) if args.first.is_a?(Display) || args.first.nil? display = args.delete_at(0) elsif parent.is_a?(GWidget) || parent.is_a?(CustomWidget) display = parent.widget.display else display = GDisplay.instance.display end GColor.new(display, *args) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems