3 #include "parser/parse.h"
7 #include <gdk-pixbuf/gdk-pixbuf.h>
9 #define OB_ICON "openbox-icon"
11 static GtkWidget *mainwin;
12 static GdkPixbuf *ob_icon;
14 static void obconf_error(GError *e)
18 d = gtk_message_dialog_new(mainwin ? GTK_WINDOW(mainwin) : NULL,
19 GTK_DIALOG_DESTROY_WITH_PARENT,
23 gtk_dialog_run(GTK_DIALOG(d));
24 gtk_widget_destroy(d);
27 static void load_stock ()
29 GtkIconFactory *factory;
32 gtk_icon_factory_add_default (factory = gtk_icon_factory_new ());
34 ob_icon = gdk_pixbuf_new_from_file (PIXMAPDIR G_DIR_SEPARATOR_S
37 gchar *msg = g_strdup_printf
38 (_("Failed to load the Openbox icon, Openbox is probably not "
39 "installed correctly. The error given was '%s'."),
47 set = gtk_icon_set_new_from_pixbuf (ob_icon);
48 gtk_icon_factory_add (factory, OB_ICON, set);
49 gtk_icon_set_unref (set);
53 int main(int argc, char **argv)
56 gtk_init(&argc, &argv);
60 mainwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
61 gtk_window_set_title(GTK_WINDOW(mainwin), "Obconf");
62 gtk_window_set_wmclass(GTK_WINDOW(mainwin), "obconf", "Obconf");
63 gtk_window_set_role(GTK_WINDOW(mainwin), "main window");
64 if (ob_icon) gtk_window_set_icon(GTK_WINDOW(mainwin), ob_icon);
66 gtk_widget_show_all(mainwin);
72 gboolean on_mainwindow_delete_event(GtkWidget *w, GdkEvent *e, gpointer d)
78 void on_quit_activate(GtkMenuItem *item, gpointer d)
83 void on_applybutton_clicked(GtkButton *but, gpointer d)
88 void on_revertbutton_clicked(GtkButton *but, gpointer d)
90 g_message("revert\n");
93 void on_helpbutton_clicked(GtkButton *but, gpointer d)
98 void on_sectiontree_row_activated(GtkTreeView *tree, GtkTreePath *path,
99 GtkTreeViewColumn *col, gpointer p)
101 g_message("activated\n");