Class: Interphase::Label

Inherits:
Widget
  • Object
show all
Defined in:
lib/interphase/widgets/label.rb

Overview

A text label.

Instance Attribute Summary

Attributes inherited from Widget

#gtk_instance, #name, #parent

Instance Method Summary collapse

Methods inherited from Widget

#destroy, #method_missing, #on, #respond_to_missing?, #show, #size

Constructor Details

#initialize(text = '', **options, &block) ⇒ Label

Creates a new label.



9
10
11
# File 'lib/interphase/widgets/label.rb', line 9

def initialize(text = '', **options, &block)
  super(Gtk::Label.new(text), options, &block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Interphase::Widget

Instance Method Details

#textObject

Retrieve the label’s text.



19
20
21
# File 'lib/interphase/widgets/label.rb', line 19

def text
  gtk_instance.text
end

#text=(value) ⇒ Object

Set the text in this label.



14
15
16
# File 'lib/interphase/widgets/label.rb', line 14

def text=(value)
  gtk_instance.text = value
end