#include #include "gtkloader.h" extern "C" { #include "gtk-imports.h" } #include "yellownotes.h" SIGNAL(YellowNotes, on_tray_activate, popupTrayMenu) static void activate (GtkApplication* app, gpointer user_data) { GtkWidget *window; YellowNotes *notes = YELLOWNOTES(user_data); GtkStatusIcon *tray = gtk_status_icon_new_from_file(notes->imageFile("yellownotes.svg").c_str()); g_signal_connect(tray, "activate", on_tray_activate, notes); } 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); YellowNotes notes(app); g_signal_connect (app, "activate", activate, ¬es); status = g_application_run(app, argc, argv); notes.loadNotes(); gtk_main(); g_object_unref (app); return status; }