Skip to content

Repository files navigation

syskit-ui

GTK4-based (gtk-ruby) UI components for browsing MetaRuby model hierarchies, as used by Syskit.

Installation

The package is part of the TideWise autoproj workspace. The gtk4 gem is declared as an osdeps dependency through autoproj/Gemfile.

Usage

require "syskit/ui"
require "gtk4"

browser = Syskit::UI::ModelBrowser.new(MyModelRoot)
browser.on_selection_changed { |model| puts "selected #{model}" }

window = Gtk::Window.new
window.child = browser
window.show

Gtk.init
Gtk.main

ModelBrowser

Syskit::UI::ModelBrowser is a Gtk::Box widget that, given a model root (a class/module that includes MetaRuby::Registration, typically through MetaRuby::ModelAsClass or MetaRuby::ModelAsModule), displays all registered submodels as a tree.

The tree is organized by the models' constant-name hierarchy, not by the model parent-child relationship. For instance, a model named Seabots::Compositions::SomeComposition will appear under the Seabots namespace node, then Compositions, and finally as a leaf node SomeComposition, regardless of what its parent model is.

It uses MetaRuby::Registration#each_submodel to recursively collect all submodels, then builds a Gtk::TreeStore from their names.

About

GUI for Syskit systems

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages