Class: Wmadd::X::GC

Inherits:
Object
  • Object
show all
Defined in:
lib/wmadd/x.rb

Instance Method Summary collapse

Constructor Details

#initialize(display, window, gc) ⇒ GC

Returns a new instance of GC.



631
632
633
634
635
# File 'lib/wmadd/x.rb', line 631

def initialize(display, window, gc)
  @display = display
  @window = window
  @gc = gc
end

Instance Method Details

#draw_string(x, y, string) ⇒ Object



649
650
651
# File 'lib/wmadd/x.rb', line 649

def draw_string(x, y, string)
  X11::XDrawString(@display, @window, @gc, x, y, string, string.length)
end

#fill_rectangle(x, y, width, height) ⇒ Object



653
654
655
# File 'lib/wmadd/x.rb', line 653

def fill_rectangle(x, y, width, height)
  X11::XFillRectangle(@display, @window, @gc, x, y, width, height)
end

#set_background(color) ⇒ Object



637
638
639
# File 'lib/wmadd/x.rb', line 637

def set_background(color)
  X11::XSetBackground(@display, @gc, color)
end

#set_font(font) ⇒ Object



645
646
647
# File 'lib/wmadd/x.rb', line 645

def set_font(font)
  X11::XSetFont(@display, @gc, font)
end

#set_foreground(color) ⇒ Object



641
642
643
# File 'lib/wmadd/x.rb', line 641

def set_foreground(color)
  X11::XSetForeground(@display, @gc, color)
end