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 g_signal_connect_swapped(GTK_OBJECT(d
), "response",
24 G_CALLBACK(gtk_widget_destroy
),
29 static void load_stock ()
31 GtkIconFactory
*factory
;
34 gtk_icon_factory_add_default (factory
= gtk_icon_factory_new ());
36 ob_icon
= gdk_pixbuf_new_from_file (PIXMAPDIR G_DIR_SEPARATOR_S
39 gchar
*msg
= g_strdup_printf
40 (_("Failed to load the Openbox icon, Openbox is probably not "
41 "installed correctly. The error given was '%s'."),
49 set
= gtk_icon_set_new_from_pixbuf (ob_icon
);
50 gtk_icon_factory_add (factory
, OB_ICON
, set
);
51 gtk_icon_set_unref (set
);
55 int main(int argc
, char **argv
)
58 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");
65 gtk_widget_show_all(mainwin
);
68 if (ob_icon
) gtk_window_set_icon(GTK_WINDOW(mainwin
), ob_icon
);
74 gboolean
on_mainwindow_delete_event(GtkWidget
*w
, GdkEvent
*e
, gpointer d
)
80 void on_quit_activate(GtkMenuItem
*item
, gpointer d
)
85 void on_applybutton_clicked(GtkButton
*but
, gpointer d
)
90 void on_revertbutton_clicked(GtkButton
*but
, gpointer d
)
92 g_message("revert\n");
95 void on_helpbutton_clicked(GtkButton
*but
, gpointer d
)
100 void on_sectiontree_row_activated(GtkTreeView
*tree
, GtkTreePath
*path
,
101 GtkTreeViewColumn
*col
, gpointer p
)
103 g_message("activated\n");