1616#
1717require 'gtk3'
1818
19- class DatabaseDialog < Gtk ::Dialog
20- def initialize ( parent )
21- super ( title : "Database" , parent : parent , flags : :modal )
22- self . add_button ( Gtk ::Stock ::CANCEL , :cancel )
23- self . add_button ( Gtk ::Stock ::APPLY , :apply )
24- ok = self . add_button ( Gtk ::Stock ::OK , :ok )
19+ class DatabaseWindow < Gtk ::Window
20+ def initialize
21+ super ( )
22+ self . title = "Database"
23+
24+ buttons = Gtk ::ButtonBox . new ( :horizontal )
25+ buttons . layout = :end
26+ buttons . spacing = 4
27+ cancel = Gtk ::Button . new ( stock_id : Gtk ::Stock ::CANCEL )
28+ apply = Gtk ::Button . new ( stock_id : Gtk ::Stock ::APPLY )
29+ ok = Gtk ::Button . new ( stock_id : Gtk ::Stock ::OK )
2530 ok . style_context . add_class ( "suggested-action" )
31+ buttons . add ( cancel )
32+ buttons . add ( apply )
33+ buttons . add ( ok )
2634
2735 notebook = Gtk ::Notebook . new
2836 notebook . tab_pos = :left
2937 notebook . vexpand = true
38+ notebook . scrollable = true
3039
3140 widget = ActorEditor . new
3241 notebook . append_page ( widget , Gtk ::Label . new ( "Actors" ) )
@@ -43,8 +52,11 @@ def initialize(parent)
4352 not_implemented ( notebook , "Tilesets" )
4453 not_implemented ( notebook , "Common\n Events" )
4554 not_implemented ( notebook , "System" )
46-
47- self . child . add ( notebook )
55+
56+ vbox = Gtk ::Box . new ( :vertical )
57+ vbox . add ( notebook )
58+ vbox . add ( buttons )
59+ self . add ( vbox )
4860 self . show_all
4961 end
5062 def not_implemented ( notebook , name )
0 commit comments