Sha256: 0e21ebad78feb1bee4356415f9f8df2eb068cc11510a715ef1c5dc5cc9590673

Contents?: true

Size: 903 Bytes

Versions: 2

Compression:

Stored size: 903 Bytes

Contents

Gtk.load_class :MessageDialog

module Gtk
  # Add non-introspected function to Gtk::Lib
  module Lib
    attach_function :gtk_message_dialog_new, [:pointer,
                                              Gtk::DialogFlags,
                                              Gtk::MessageType,
                                              Gtk::ButtonsType,
                                              :string,
                                              :varargs], :pointer
  end

  # Overrides for GtkMessageDialog
  class MessageDialog
    alias_method :old_initialize, :initialize

    def initialize(parent, flags, type, buttons, message)
      ptr = Gtk::Lib.gtk_message_dialog_new(parent, flags, type, buttons,
                                            '%s',
                                            :string, message)
      store_pointer(ptr)
    end

    remove_method :old_initialize
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gir_ffi-gtk-0.10.0 lib/gir_ffi-gtk/message_dialog.rb
gir_ffi-gtk-0.9.0 lib/gir_ffi-gtk/message_dialog.rb