Method: Gtk::Builder#initialize
- Defined in:
- lib/gtk4/builder.rb
#initialize(options = {}) ⇒ Builder
Returns a new instance of Builder.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/gtk4/builder.rb', line 22 def initialize(={}) object = [:object] path = [:path] || [:file] resource = [:resource] string = [:string] initialize_new set_current_object(object) if object set_scope(RubyBuilderScope.new) if path path = path.to_path if path.respond_to?(:to_path) add_from_file(path) elsif resource add_from_resource(resource) elsif string add_from_string(string) end end |