1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
# -*- coding: utf-8 -*-
require "gtk2"
require_relative 'toolbar_generator'
class Gtk::TabToolbar < Gtk::HBox
def initialize(imaginally, *args)
type_strict imaginally => Plugin::GUI::TabToolbar
@imaginally = imaginally
super(*args)
end
def set_button
self.children.each(&method(:remove))
current_world, = Plugin.filtering(:world_current, nil)
Plugin::Gtk::ToolbarGenerator.generate(
self,
Plugin::GUI::Event.new(
event: :tab_toolbar,
widget: @imaginally.parent,
messages: [],
world: current_world
),
:tab)
end
end
|