aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv_gtkmm2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jalv_gtkmm2.cpp')
-rw-r--r--src/jalv_gtkmm2.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/jalv_gtkmm2.cpp b/src/jalv_gtkmm2.cpp
index 3f5a0e9..065b971 100644
--- a/src/jalv_gtkmm2.cpp
+++ b/src/jalv_gtkmm2.cpp
@@ -24,7 +24,7 @@ LV2_DISABLE_DEPRECATION_WARNINGS
#include <gtkmm/window.h>
LV2_RESTORE_WARNINGS
-Gtk::Main* jalv_gtk_main = NULL;
+static Gtk::Main* jalv_gtk_main = nullptr;
int
jalv_init(int* argc, char*** argv, JalvOptions* opts)
@@ -70,23 +70,27 @@ jalv_open_ui(Jalv* jalv)
Gtk::Window* window = new Gtk::Window();
if (jalv->ui) {
- jalv_ui_instantiate(jalv, jalv_native_ui_type(), NULL);
+ jalv_ui_instantiate(jalv, jalv_native_ui_type(), nullptr);
}
if (jalv->ui_instance) {
- GtkWidget* widget = (GtkWidget*)suil_instance_get_widget(
- jalv->ui_instance);
+ GtkWidget* widget = static_cast<GtkWidget*>(
+ suil_instance_get_widget(jalv->ui_instance));
+
Gtk::Widget* widgetmm = Glib::wrap(widget);
window->add(*Gtk::manage(widgetmm));
widgetmm->show_all();
g_timeout_add(1000 / jalv->ui_update_hz,
- (GSourceFunc)jalv_update, jalv);
+ reinterpret_cast<GSourceFunc>(jalv_update),
+ jalv);
} else {
Gtk::Button* button = Gtk::manage(new Gtk::Button("Close"));
window->add(*Gtk::manage(button));
}
+ jalv_init_ui(jalv);
+
window->set_resizable(jalv_ui_is_resizable(jalv));
window->show_all();