39 lines
789 B
C++
39 lines
789 B
C++
#include <iostream>
|
|
#include "gtkloader.h"
|
|
|
|
extern "C" {
|
|
#include "gtk-imports.h"
|
|
}
|
|
|
|
static void activate (GtkApplication* app, gpointer user_data)
|
|
{
|
|
GtkWidget *window;
|
|
|
|
window = gtk_application_window_new (app);
|
|
gtk_window_set_title (window, "Window");
|
|
gtk_window_set_default_size (window, 200, 200);
|
|
gtk_widget_show_all (window);
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
GtkLoader l;
|
|
|
|
try {
|
|
l.loadGtk();
|
|
} catch(std::string msg) {
|
|
std::cerr << msg << std::endl;
|
|
}
|
|
|
|
GtkApplication *app;
|
|
int status;
|
|
|
|
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
|
g_signal_connect (app, "activate", activate, NULL);
|
|
status = g_application_run (app, argc, argv);
|
|
g_object_unref (app);
|
|
|
|
return status;
|
|
}
|
|
|