Class: WindowGeometry::X::GC

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

Instance Method Summary collapse

Constructor Details

#initialize(display, window, gc) ⇒ GC

Returns a new instance of GC.



371
372
373
374
375
# File 'lib/window_geometry/x.rb', line 371

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

Instance Method Details

#draw_string(x, y, string) ⇒ Object



389
390
391
# File 'lib/window_geometry/x.rb', line 389

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

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



393
394
395
# File 'lib/window_geometry/x.rb', line 393

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

#set_background(color) ⇒ Object



377
378
379
# File 'lib/window_geometry/x.rb', line 377

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

#set_font(font) ⇒ Object



385
386
387
# File 'lib/window_geometry/x.rb', line 385

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

#set_foreground(color) ⇒ Object



381
382
383
# File 'lib/window_geometry/x.rb', line 381

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