Sha256: e256cdfc91fdf5e897e02b2af7c85a35a279c1f2ab857eae0bba73abdd6cf820

Contents?: true

Size: 900 Bytes

Versions: 10

Compression:

Stored size: 900 Bytes

Contents

# frozen_string_literal: true

Gtk.load_class :RadioButton
module Gtk
  # Add non-introspected functions to Gtk::Lib
  module Lib
    attach_function :gtk_radio_button_new, [:pointer], :pointer
    attach_function :gtk_radio_button_new_from_widget, [:pointer], :pointer
  end

  # Overrides for GtkRadioButton
  class RadioButton
    def self.new_from_widget(*args)
      obj = allocate
      obj.send :initialize_from_widget, *args
      obj
    end

    alias old_initialize initialize

    def initialize(group)
      list = GLib::SList.from(Gtk::RadioButton, group)
      ptr = Gtk::Lib.gtk_radio_button_new(list)
      store_pointer(ptr)
    end

    remove_method :old_initialize

    def initialize_from_widget(radio_group_member)
      widget = Gtk::RadioButton.from(radio_group_member)
      ptr = Gtk::Lib.gtk_radio_button_new_from_widget(widget)
      store_pointer(ptr)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gir_ffi-gtk-0.17.0 lib/gir_ffi-gtk/gtk2/radio_button.rb
gir_ffi-gtk-0.16.0 lib/gir_ffi-gtk/gtk2/radio_button.rb
gir_ffi-gtk-0.15.1 lib/gir_ffi-gtk/gtk2/radio_button.rb
gir_ffi-gtk-0.15.0 lib/gir_ffi-gtk/gtk2/radio_button.rb
gir_ffi-gtk-0.14.1 lib/gir_ffi-gtk/gtk2/radio_button.rb
gir_ffi-gtk-0.14.0 lib/gir_ffi-gtk/gtk2/radio_button.rb
gir_ffi-gtk-0.13.1 lib/gir_ffi-gtk/gtk2/radio_button.rb
gir_ffi-gtk-0.13.0 lib/gir_ffi-gtk/gtk2/radio_button.rb
gir_ffi-gtk-0.12.1 lib/gir_ffi-gtk/gtk2/radio_button.rb
gir_ffi-gtk-0.12.0 lib/gir_ffi-gtk/gtk2/radio_button.rb