mvz / gir_ffi-gtk

GirFFI-based bindings for Gtk+. Supports both Gtk+ 2 and Gtk+ 3
GNU Lesser General Public License v2.1
18 stars 7 forks source link

gtk4 support? #102

Closed rubyFeedback closed 1 year ago

rubyFeedback commented 2 years ago

Ruby-gtk4 recently added support for gtk4 (Well, actually ruby-gnome, but ruby-gtk4 is part of these bindings there). I also tested hello world, it works:

Here the copy paste version for you guys to test.

#!/usr/bin/env ruby 
require 'gtk4'

application = Gtk::Application.new('org.gtk.example', :flags_none)

application.signal_connect(:activate) { |app|
  win = Gtk::ApplicationWindow.new(app)
  win.title = 'window'
  win.set_default_size(600, 400)

  button = Gtk::Button.new(label: 'Hello World')
  button.signal_connect(:clicked) {
    puts "Hello World"
    win.destroy
  }
  win.set_child(button)
  win.show
}

application.run

Are there plans for gir_ffi-gtk to add support?

The API changed quite a lot but by and large ruby-gtk4 is not so dissimilar to ruby-gtk3 so at the least for simple examples, I think it should not be too difficult to get it to work.

mvz commented 2 years ago

Hi @rubyFeedback, Gtk4 support is planned for a different gem: https://github.com/mvz/gir_ffi-gtk4.