Class: RUI::GuiBuilder::Label

Inherits:
Object
  • Object
show all
Includes:
RUI::GuiBuilder
Defined in:
lib/rui/toolkits/qtbase/gui_builder.rb

Overview

A label.

The label text is specified by the text attribute.

A buddy attribute can also be specified as a widget id. The widget with the given id will be set as the buddy of this label as GUI construction time.

Instance Method Summary collapse

Methods included from RUI::GuiBuilder

build, #build, #builder, #setup_widget

Instance Method Details

#create_element(window, parent, desc) ⇒ Object



206
207
208
209
210
211
212
213
# File 'lib/rui/toolkits/qtbase/gui_builder.rb', line 206

def create_element(window, parent, desc)
  label = Qt::Label.new(desc.opts[:text].to_s, window)
  setup_widget(label, window, parent, desc)
  if desc.opts[:buddy]
    window.buddies[label] = desc.opts[:buddy]
  end
  label
end