Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ============================================================= #
- # For GTK2 Colours
- # ============================================================= #
- # require 'x/STD/std_gtk2.rb'
- # include GTK2Colours
- # GTK2Colours::BLACK
- # ============================================================= #
- # grepcomment $RUBY_STD/std_gtk2.rb
- # ============================================================= #
- begin
- require 'gtk2'
- rescue LoadError => e
- puts "LoadError: Cant load gtk2 (#{e})"
- end
- RUBY_RESERVED_WORDS = %w(
- begin end module class def if then else
- while unless do case when require yield
- )
- # ========================================================================= #
- # Needed that for some GTK thingy. Its also in std_classes.
- # ========================================================================= #
- class Integer
- define_method(:is_odd?) { self % 2 != 0 }
- define_method(:is_even?) { self % 2 == 0 }
- end
- # ========================================================================= #
- # Extend Gtk::Entry
- # add append_text method
- # ========================================================================= #
- class Gtk::Entry
- # ======================================================================= #
- # === append_text
- # ======================================================================= #
- def append_text(this_text)
- self.set_text(self.text + this_text)
- end
- end
- # ====================================================================== #
- # ImageMenuItem.new
- # A specialized Menuitem with a nice little icon to the left.
- # ====================================================================== #
- class ImageMenuItem < Gtk::MenuItem
- # ==================================================== #
- # img_location gives the path of the image.
- # ==================================================== #
- def initialize(text_to_display='Play Video',
- img_location=nil,
- n_pad=0) # default: add 0 spaces to our text
- super()
- if img_location.nil?
- img_location = '/Users/x/DATA/IMG/STD/MINI_DOT.png'
- end
- @text_to_display = text_to_display
- @text_to_display = pad_to(n_pad)
- image = Gtk::Image.new(img_location)
- @menu_item = Gtk::MenuItem.new(@text_to_display)
- hbox = Gtk::HBox.new
- hbox.add(image).add(@menu_item)
- self.add(hbox)
- end
- # ==================================================== #
- # just padd our string a bit
- # ==================================================== #
- def pad_to(n_times=0)
- pad = ''
- pad = ' ' * n_times unless n_times==0
- _ = @text_to_display+ pad
- return _
- end
- end
- # ========================================================================= #
- # === create_main_window
- # Creates a main window.
- #
- # Alternatively (recommended) do one of these, with last comes best:
- # main_window.signal_connect('delete_event'){ Gtk::main_quit }
- # main_window = create_main_window(800,600)
- # main_window = create_main_window(height=600,width=400, optional_icon_path = nil,this_title=nil,border=nil)
- # main_window = create_main_window(600,400, 'iconpath','title',3)
- # ========================================================================= #
- def create_main_window(height=600, width=400, optional_icon_path=nil, this_title=nil,border=nil)
- main_window = Gtk::Window.new()
- #main_window.signal_connect('destroy') { Gtk.main_quit }
- main_window.signal_connect('delete_event'){ Gtk::main_quit }
- main_window.set_size_request(height, width)
- main_window.set_title(this_title)
- if optional_icon_path # if we pass a path to an icon, we will use it as icon
- # puts optional_icon_path
- main_window.set_icon(Gdk::Pixbuf.new(optional_icon_path))
- end
- unless border.nil?
- main_window.border_width=border
- end
- return main_window
- end
- # ========================================================================= #
- # === create_gtk_source_view
- # Creates a default Gtk::SourceView object.
- # ========================================================================= #
- def create_gtk_source_view(buffer_to_use)
- _ = Gtk::SourceView.new(buffer_to_use)
- _.show_line_numbers=true
- _.show_line_markers=true
- _.smart_home_end=true
- _.tabs_width=2
- return _
- end
- # ========================================================================= #
- # === create_cell_renderer_text(foreground_colour,background_colour)
- # ========================================================================= #
- def create_cell_renderer_text
- renderer=Gtk::CellRendererText.new
- renderer.set_property( 'foreground', foreground_colour)
- renderer.set_property( 'background', background_colour )
- return renderer
- end
- # ========================================================================= #
- # === standard_file_chooser_dialog
- # returns a file chooser dialog.
- # ========================================================================= #
- def standard_file_chooser_dialog(title,widget)
- _= Gtk::FileChooserDialog.new(title,widget,
- Gtk::FileChooser::ACTION_OPEN, nil,
- [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL],
- [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT]
- )
- return _
- end
- # ========================================================================= #
- # === table1
- # will return a table with a 1 columns layout.
- # ========================================================================= #
- def table1(*all_args)
- table = Gtk::Table.new(all_args.size, 2, true)
- counter = 0
- slow_counter = 0
- for element in all_args
- # print (counter % 2),' ',(counter % 2)+1,' ',slow_counter,' ',slow_counter+1,"\n"
- table.attach_defaults(
- element,
- (counter % 1), (counter % 1)+1,
- slow_counter, slow_counter+1
- )
- counter += 1
- slow_counter += 1 #if counter % 2 == 0
- end
- return table
- end
- # ========================================================================= #
- # === table2
- # Will return a table with a 2 columns layout.
- # ========================================================================= #
- def table2(*all_args)
- table = Gtk::Table.new(all_args.size / 2, 2, true)
- counter = 0
- slow_counter = 0
- for element in all_args
- # print (counter % 2),' ',(counter % 2)+1,' ',slow_counter,' ',slow_counter+1,"\n"
- table.attach_defaults(
- element,
- (counter % 2), (counter % 2)+1,
- slow_counter, slow_counter+1
- )
- counter += 1
- slow_counter += 1 if counter % 2 == 0
- end
- return table
- end
- # ========================================================================= #
- # === table3
- # will return a table with a 3 columns layout.
- # ========================================================================= #
- def table3(*all_args)
- table = Gtk::Table.new(all_args.size / 3, 2, true)
- counter = 0
- slow_counter = 0
- for element in all_args
- # print (counter % 2),' ',(counter % 2)+1,' ',slow_counter,' ',slow_counter+1,"\n"
- table.attach_defaults(
- element,
- (counter % 3), (counter % 3)+1,
- slow_counter, slow_counter+1
- )
- counter += 1
- slow_counter += 1 if counter % 3 == 0
- end
- return table
- end
- # ========================================================================= #
- # === remove_all_pages
- # Removes all pages from a Gtk Notebook.
- # Examples:
- # remove_all_pages(@notebook)
- # ========================================================================= #
- def remove_all_pages(which_widget)
- which_widget.n_pages.times do |index|
- which_widget.remove_page(index)
- end
- end
- # ========================================================================= #
- # === random_coordinate_move
- # this either returns - or +
- # random_coordinate_move(range=100)
- # ========================================================================= #
- def random_coordinate_move(range=100)
- case rand(2)
- when 0 then return rand(range)
- when 1 then return -rand(range)
- end
- end
- # ========================================================================= #
- # === which_mouse_button
- # puts event.button
- # which mouse button was pressed?
- # puts which_mouse_button(event.button)
- # ========================================================================= #
- def which_mouse_button(type)
- case type
- when 3 then return 'right'
- when 2 then return 'middle'
- when 1 then return 'left'
- else
- return 'unknown'
- end
- end
- # ========================================================================= #
- # === create_canvas_rect
- # should create more
- # create_canvas_rect(@canvas_group)
- # ========================================================================= #
- def create_canvas_rect(widget,x1=115.0)
- return Gnome::CanvasRect.new(widget,
- {
- :x1 => x1,
- :y1 => 66.0,
- :x2 => 220.0,
- :y2 => 120.0,
- :outline_color => 'black',
- :fill_color => 'green',
- :width_units => 2.0
- }
- )
- end
- # ========================================================================= #
- # === modify_label
- # Its for doing coloured labels. 2nd arg is default.
- # modify_label('test1','green')
- # modify_label('URL: ','darkblue')
- # ========================================================================= #
- def modify_label(name, colour = 'darkblue')
- return Gtk::Label.new(name).set_markup( %Q[#{name} ], true)
- end
- # ========================================================================= #
- # === modify_bold_label
- # Wrapper to easier modify the colours
- # of a label, using bold label. Can be useful. The core of it
- # is the method set_markup, as in:
- # set_markup(%Q[<markup><span weight="bold" foreground="#{colour}">Test</span></markup>], true)
- # Usage examples:
- # modify_bold_label('LE: ','red')
- # modify_bold_label('AttackMe: ','slateblue')
- # ========================================================================= #
- def modify_bold_label(name, colour,justify=nil)
- _ = Gtk::Label.new(name)
- _.set_markup(%Q[<markup><span weight="bold" foreground="#{colour}">#{name} </span></markup>], true)
- unless justify.nil?
- case justify
- when :center then _.set_justify(Gtk::JUSTIFY_CENTER)
- when :left then _.set_justify(Gtk::JUSTIFY_RIGHT)
- when :fill then _.set_justify(Gtk::JUSTIFY_FILL)
- else
- _.set_justify(Gtk::JUSTIFY_LEFT)
- end
- end
- return _
- end
- # ========================================================================= #
- # === create_coloured_button('name')
- # See coloured_button.rb please!
- # ========================================================================= #
- # ========================================================================= #
- # === make_shortcut_key_for_gtk_entry
- # makes a shortcut key.
- # Arguments:
- # - main_window is the main window which covers all your sub
- # windows
- # Example Code:
- #
- # .make_shortcut_key_for_gtk_entry(@main_window,@accel_group,'1',@entry)
- # ========================================================================= #
- def make_shortcut_key_for_gtk_entry(main_window,
- accel_group,
- shortcut_key = 'b',
- the_entry = '')
- accel_group.connect(
- Gdk::Keyval.from_name(shortcut_key.to_s),
- Gdk::Window::MOD1_MASK,
- Gtk::ACCEL_VISIBLE) do
- set_focus_and_select(the_entry)
- end
- main_window.add_accel_group(accel_group).show_all
- end
- # ========================================================================= #
- # === set_focus_and_select
- # pass a GTK::Entry to this method.
- # ========================================================================= #
- def set_focus_and_select(this_entry)
- this_entry.set_focus( true )
- this_entry.select_region( 0, -1 )
- end
- # ========================================================================= #
- # === text
- # Creates a new Gtk::Label.
- # ========================================================================= #
- def text(this_string)
- tmp = Gtk::Label.new(this_string)
- return tmp
- end
- # ========================================================================= #
- # === create_entry_with_text_and_max_length
- # Creates a new gtk entry.
- # ========================================================================= #
- def create_entry_with_text_and_max_length(text='bla',max_length=50)
- tmp = Gtk::Entry.new
- tmp.set_max_length(max_length)
- tmp.set_text(text)
- return tmp
- end
- # ========================================================================= #
- # === create_event_image
- # Simple event.
- # create_event_image(file_url=HSS['IMG_RPG']+"ADOPTION/WALDSZENE.jpg")
- # ========================================================================= #
- def create_event_image(file_url=HSS['IMG_RPG']+'ADOPTION/WALDSZENE.jpg')
- image = Gtk::Image.new(file_url)
- event_box = Gtk::EventBox.new.add(image)
- event_box.signal_connect("button_press_event") do
- cme('Clicked.')
- end
- return event_box
- end
- # =============================================================== #
- # Contains key specific stuff.
- # =============================================================== #
- module GTK2Keys
- ARROW_KEYS = [
- Gdk::Keyval::GDK_Left,
- Gdk::Keyval::GDK_Right,
- Gdk::Keyval::GDK_Up,
- Gdk::Keyval::GDK_Down
- ]
- end
- # ==================================================================== #
- # Store xbm files in this Module.
- # include XbmIcons
- # Listing:
- # ==================================================================== #
- # XbmIcons::XBM_SWORD_ICON
- # XbmIcons::BOOK_CLOSED_XPM
- # XbmIcons::BOOK_OPENED_XPM
- # ==================================================================== #
- module XbmIcons
- XBM_SWORD_ICON = [
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x40,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x04, 0x00, 0x00, 0x00, 0x10, 0x07, 0x00, 0x00, 0x00, 0xc0, 0x02, 0x00,
- 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00,
- 0x78, 0x03, 0x00, 0x00, 0x00, 0x58, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0e,
- 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
- 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00,
- 0xe0, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00
- ].pack("c*")
- # Nun die XPM Icons.
- # XbmIcons::BOOK_OPENED_XPM
- BOOK_OPENED_XPM = [
- "16 16 4 1",
- " c None s None",
- ". c black",
- "X c #808080",
- "o c white",
- " ",
- " .. ",
- " .Xo. ... ",
- " .Xoo. ..oo. ",
- " .Xooo.Xooo... ",
- " .Xooo.oooo.X. ",
- " .Xooo.Xooo.X. ",
- " .Xooo.oooo.X. ",
- " .Xooo.Xooo.X. ",
- " .Xooo.oooo.X. ",
- " .Xoo.Xoo..X. ",
- " .Xo.o..ooX. ",
- " .X..XXXXX. ",
- " ..X....... ",
- " .. ",
- " "]
- # XbmIcons::::BOOK_CLOSED_XPM
- BOOK_CLOSED_XPM = [
- "16 16 6 1",
- " c None s None",
- ". c black",
- "X c red",
- "o c yellow",
- "O c #808080",
- "# c white",
- " ",
- " .. ",
- " ..XX. ",
- " ..XXXXX. ",
- " ..XXXXXXXX. ",
- ".ooXXXXXXXXX. ",
- "..ooXXXXXXXXX. ",
- ".X.ooXXXXXXXXX. ",
- ".XX.ooXXXXXX.. ",
- " .XX.ooXXX..#O ",
- " .XX.oo..##OO. ",
- " .XX..##OO.. ",
- " .X.#OO.. ",
- " ..O.. ",
- " .. ",
- " "
- ]
- end
- # ============================================================== #
- # CanvasPack exists to give you loads of little
- # graphical objects to use in your application.
- # ============================================================== #
- # include CanvasPack
- # ============================================================== #
- module CanvasPack
- WIDTH = 6
- HEIGHT = 6
- require 'gnomecanvas2'
- # =================================================================== #
- # CanvasPack::Glass.new
- # =================================================================== #
- class Glass < Gnome::CanvasGroup
- def initialize(root,col_factor=2,row_factor=2)
- super(root,
- :x => 0,
- :y => 0)
- Gnome::CanvasEllipse.new(self,
- :x1 => 0,
- :y1 => 0,
- :x2 => (col_factor + 2) * WIDTH,
- :y2 => (row_factor + 2) * HEIGHT,
- :outline_color => 'gray',
- :fill_color => 'orange',
- :width_units => 1.0
- )
- end
- end
- # =================================================================== #
- # CanvasPack::RedBall.new
- # =================================================================== #
- class RedBall < Gnome::CanvasGroup
- def initialize(root,col_factor=3,row_factor=3)
- @col_factor = col_factor
- @row_factor = row_factor
- super(root,
- :x => @col_factor * WIDTH,
- :y => @row_factor * HEIGHT)
- Gnome::CanvasEllipse.new(self,
- :x1 => 2,
- :y1 => 2,
- :x2 => WIDTH*2,
- :y2 => HEIGHT*2,
- :outline_color => 'black',
- :fill_color => 'red',
- :width_units => 1.0
- )
- Gnome::CanvasEllipse.new(self,
- :x1 => 4,
- :y1 => 4,
- :x2 => WIDTH,
- :y2 => 2+WIDTH,
- :outline_color => 'white',
- :fill_color => 'white',
- :width_units => 2.0
- )
- end
- end
- end
- # =============================================================== #
- # include GTK2Colours
- # =============================================================== #
- module GTK2Colours
- # ============================================================= #
- # RED = Gdk::Color.new( 65535, 0, 0 )
- # GREEN = Gdk::Color.new( 0, 65535, 0 )
- # BLUE = Gdk::Color.new( 0, 0, 65535 )
- # ============================================================= #
- # ============================================================= #
- # Da Gdk nicht immer verfügbar ist, müssen wir
- # das ganze in begin/rescue einfangen.
- # ============================================================= #
- begin
- # ============================================================= #
- # HIER STARTET DIE ALPHABETISCHE REIHENFOLGE
- # Zum verwenden das hier nit vergessen:
- # include GTK2Colours
- # ============================================================= #
- ALICEBLUE = Gdk::Color.parse 'aliceblue'
- AQUAMARINE = Gdk::Color.parse 'aquamarine'
- AZURE = Gdk::Color.parse 'azure'
- ANTIQUEWHITE = Gdk::Color.parse 'antiquewhite'
- BISQUE = Gdk::Color.parse 'bisque'
- BLACK = Gdk::Color.parse 'black'
- BROWN = Gdk::Color.parse 'brown'
- BLUE = Gdk::Color.parse 'blue'
- BLANCHEDALMOND = Gdk::Color.parse 'blanchedalmond'
- BEIGE = Gdk::Color.parse 'beige'
- BLUEVIOLET = Gdk::Color.parse 'blueviolet'
- BURLYWOOD = Gdk::Color.parse 'burlywood'
- CORAL = Gdk::Color.parse 'coral'
- CADETBLUE = Gdk::Color.parse 'cadetblue'
- CHOCOLATE = Gdk::Color.parse 'chocolate'
- CORNSILK = Gdk::Color.parse 'cornsilk'
- CORNFLOWERBLUE = Gdk::Color.parse 'cornflowerblue'
- CYAN = Gdk::Color.parse 'cyan'
- CHARTREUSE = Gdk::Color.parse 'chartreuse'
- # CRIMSON = Gdk::Color.parse 'crimson'
- DARKSALMON = Gdk::Color.parse 'darksalmon'
- DARKRED = Gdk::Color.parse 'darkred'
- DARKGOLDENROD = Gdk::Color.parse 'darkgoldenrod'
- DARKKHAKI = Gdk::Color.parse 'darkkhaki'
- DARKOLIVEGREEN = Gdk::Color.parse 'darkolivegreen'
- DARKSEAGREEN = Gdk::Color.parse 'darkseagreen'
- DARKGREEN = Gdk::Color.parse 'darkgreen'
- DARKTURQUOISE = Gdk::Color.parse 'darkturquoise'
- DARKCYAN = Gdk::Color.parse 'darkcyan'
- DEEPSKYBLUE = Gdk::Color.parse 'deepskyblue'
- DARKBLUE = Gdk::Color.parse 'darkblue'
- DARKGRAY = Gdk::Color.parse 'darkgray'
- DARKMAGENTA = Gdk::Color.parse 'darkmagenta'
- DARKORCHID = Gdk::Color.parse 'darkorchid'
- DARKVIOLET = Gdk::Color.parse 'darkviolet'
- DARKORANGE = Gdk::Color.parse 'darkorange'
- DARKSLATEGRAY = Gdk::Color.parse 'darkslategray'
- DEEPPINK = Gdk::Color.parse 'deeppink'
- DIMGRAY = Gdk::Color.parse 'dimgray'
- DODGERBLUE = Gdk::Color.parse 'dodgerblue'
- DARKSLATEBLUE = Gdk::Color.parse 'darkslateblue'
- FIREBRICK = Gdk::Color.parse 'firebrick'
- FLORALWHITE = Gdk::Color.parse 'floralwhite'
- FORESTGREEN = Gdk::Color.parse 'forestgreen'
- GOLD = Gdk::Color.parse 'gold'
- GOLDENROD = Gdk::Color.parse 'goldenrod'
- GREEN = Gdk::Color.parse 'green'
- GREENYELLOW = Gdk::Color.parse 'greenyellow'
- GREY = Gdk::Color.parse 'grey'
- GAINSBORO = Gdk::Color.parse 'gainsboro'
- GHOSTWHITE = Gdk::Color.parse 'ghostwhite'
- HOTPINK = Gdk::Color.parse 'hotpink'
- HONEYDEW = Gdk::Color.parse 'honeydew'
- IVORY = Gdk::Color.parse 'ivory'
- INDIANRED = Gdk::Color.parse 'indianred'
- #INDIGO= Gdk::Color.parse 'indigo'
- KHAKI = Gdk::Color.parse 'khaki'
- LAVENDERBLUSH = Gdk::Color.parse 'lavenderblush'
- LAVENDER = Gdk::Color.parse 'lavender'
- LIMEGREEN = Gdk::Color.parse 'limegreen'
- LIGHTSALMON = Gdk::Color.parse 'lightsalmon'
- LIGHTCORAL = Gdk::Color.parse 'lightcoral'
- LIGHTGOLDENRODYELLOW= Gdk::Color.parse 'lightgoldenrodyellow'
- LIGHTSTEELBLUE = Gdk::Color.parse 'lightsteelblue'
- LIGHTPINK = Gdk::Color.parse 'lightpink'
- LIGHTSLATEGRAY = Gdk::Color.parse 'lightslategray'
- LIGHTGREY = Gdk::Color.parse 'lightgrey'
- LIGHTCYAN = Gdk::Color.parse 'lightcyan'
- LIGHTBLUE = Gdk::Color.parse 'lightblue'
- LIGHTSKYBLUE = Gdk::Color.parse 'lightskyblue'
- LIGHTSEAGREEN = Gdk::Color.parse 'lightseagreen'
- LAWNGREEN = Gdk::Color.parse 'lawngreen'
- #LIME= Gdk::Color.parse 'lime'
- LIGHTGREEN = Gdk::Color.parse 'lightgreen'
- LINEN = Gdk::Color.parse 'linen'
- LIGHTYELLOW = Gdk::Color.parse 'lightyellow'
- LEMONCHIFFON = Gdk::Color.parse 'lemonchiffon'
- MOCCASIN = Gdk::Color.parse 'moccasin'
- MAGENTA = Gdk::Color.parse 'magenta'
- MEDIUMBLUE = Gdk::Color.parse 'mediumblue'
- MEDIUMORCHID = Gdk::Color.parse 'mediumorchid'
- MEDIUMPURPLE = Gdk::Color.parse 'mediumpurple'
- MEDIUMAQUAMARINE = Gdk::Color.parse 'mediumaquamarine'
- MEDIUMSPRINGGREEN = Gdk::Color.parse 'mediumspringgreen'
- MEDIUMSEAGREEN = Gdk::Color.parse 'mediumseagreen'
- MEDIUMTURQUOISE = Gdk::Color.parse 'mediumturquoise'
- MEDIUMVIOLETRED = Gdk::Color.parse 'mediumvioletred'
- MIDNIGHTBLUE = Gdk::Color.parse 'midnightblue'
- MINTCREAM = Gdk::Color.parse 'mintcream'
- MISTYROSE = Gdk::Color.parse 'mistyrose'
- MEDIUMSLATEBLUE = Gdk::Color.parse 'mediumslateblue'
- MAROON = Gdk::Color.parse 'maroon'
- NAVAJOWHITE = Gdk::Color.parse 'navajowhite'
- NAVY = Gdk::Color.parse 'navy'
- OLDLACE = Gdk::Color.parse 'oldlace'
- #OLIVE= Gdk::Color.parse 'olive'
- OLIVEDRAB = Gdk::Color.parse 'olivedrab'
- ORANGE = Gdk::Color.parse 'orange'
- ORCHID = Gdk::Color.parse 'orchid'
- ORANGERED = Gdk::Color.parse 'orangered'
- PAPAYAWHIP = Gdk::Color.parse 'papayawhip'
- PEACHPUFF = Gdk::Color.parse 'peachpuff'
- PALEGREEN = Gdk::Color.parse 'palegreen'
- PALEVIOLETRED = Gdk::Color.parse 'palevioletred'
- PALETURQUOISE = Gdk::Color.parse 'paleturquoise'
- PERU = Gdk::Color.parse 'peru'
- PINK = Gdk::Color.parse 'pink'
- PLUM = Gdk::Color.parse 'plum'
- POWDERBLUE = Gdk::Color.parse 'powderblue'
- PURPLE = Gdk::Color.parse 'purple'
- PALEGOLDENROD = Gdk::Color.parse 'palegoldenrod'
- RED = Gdk::Color.parse 'red'
- ROYALBLUE = Gdk::Color.parse 'royalblue'
- ROSYBROWN = Gdk::Color.parse 'rosybrown'
- SANDYBROWN = Gdk::Color.parse 'sandybrown'
- SALMON = Gdk::Color.parse 'salmon'
- SEAGREEN = Gdk::Color.parse 'seagreen'
- SEASHELL = Gdk::Color.parse 'seashell'
- #SILVER = Gdk::Color.parse 'silver'
- SKYBLUE = Gdk::Color.parse 'skyblue'
- SADDLEBROWN = Gdk::Color.parse 'saddlebrown'
- SIENNA = Gdk::Color.parse 'sienna'
- STEELBLUE = Gdk::Color.parse 'steelblue'
- SPRINGGREEN = Gdk::Color.parse 'springgreen'
- SLATEBLUE = Gdk::Color.parse 'slateblue'
- SNOW = Gdk::Color.parse 'snow'
- SLATEGRAY = Gdk::Color.parse 'slategray'
- TAN = Gdk::Color.parse 'tan'
- #TEAL= Gdk::Color.parse 'teal'
- THISTLE = Gdk::Color.parse 'thistle'
- TOMATO = Gdk::Color.parse 'tomato'
- TURQUOISE = Gdk::Color.parse 'turquoise'
- VIOLET = Gdk::Color.parse 'violet'
- WHITE = Gdk::Color.parse 'white'
- WHITESMOKE = Gdk::Color.parse 'whitesmoke'
- WHEAT = Gdk::Color.parse 'wheat'
- YELLOW = Gdk::Color.parse 'yellow'
- YELLOWGREEN = Gdk::Color.parse 'yellowgreen'
- rescue Exception
- puts 'Gdk not installed. Please install if possible.'
- end
- end
Add Comment
Please, Sign In to add comment