Background
I have a photo gallery generator written in Ruby. Configuration for each photo gallery and the generator itself are both in one YAML file. This tool already works in as a terminal tool. Now I want to create a GUI for this and I chose Gtk as the GUI library. I created rough UI in Glade and I have classes both for Gtk::ApplicationWindow and Gtk::Application. When I run the Ruby code the UI created in Glade really loads / displays. Now I am a bit stuck with populating GTKTreeView, which I want to use to display the config data for a user to make last adjustments before generating the galleries.
What I've tried
I found a lot of examples in C, but those usually don't deal with classes, so those are useless for me.
I also found examples in Ruby which are not using Glade and are building the whole UI programmatically by creating manually instances of Gtk classes and naturally those then have the reference in a variable.
I found a few videos of doing something similar in Python, but those were just attaching actions to buttons, so they didn't need the reference to a specific element in the UI.
Question
How do I get reference to the GTKTreeView / GTKListStore so I can populate it?
What I imagine is I need to call .get_object('<id I've set in Glade>')
on something, but have no idea on what.
In case it is not clear from "What I've tried"… I am not looking for example in C or example where the whole UI is done programmatically.
Tools used
- Ruby
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
- Glade
3.40.0
(from Homebrew on macOS) - Gtk
3.24.41
(from Homebrew on macOS, using Gtk 3 because Glade is not compatible with Gtk 4) - Gtk gem
gtk3 (4.2.2)
(from ruby gems)