Class: Gtk::Dialog

Inherits:
Object
  • Object
show all
Defined in:
lib/gir_ffi-gtk/dialog.rb

Overview

Overrides for GtkDialog

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new_with_buttons(*args) ⇒ Object



16
17
18
19
20
# File 'lib/gir_ffi-gtk/dialog.rb', line 16

def self.new_with_buttons(*args)
  obj = allocate
  obj.send :initialize_with_buttons, *args
  obj
end

Instance Method Details

#initialize_with_buttons(title, parent, flags, buttons) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/gir_ffi-gtk/dialog.rb', line 22

def initialize_with_buttons(title, parent, flags, buttons)
  button_params = buttons.flat_map do |button_text, button_response|
    [:string, button_text, :int, Gtk::ResponseType.to_int(button_response)]
  end
  ptr = Gtk::Lib.gtk_dialog_new_with_buttons(title, parent, flags,
                                             *button_params, :string, nil)
  store_pointer(ptr)
end