Update files and themes on selection changed.
[lxde/lxappearance.git] / src / main.c
1 /*
2 * Initial main.c file generated by Glade. Edit as required.
3 * Glade will not overwrite this file.
4 */
5
6 #ifdef HAVE_CONFIG_H
7 # include <config.h>
8 #endif
9
10 #include <gtk/gtk.h>
11 #include <string.h>
12
13 #include "main-dlg-ui.h"
14 #include "demo.h"
15 #include "glade-support.h"
16
17 static void reload_all_programs( gboolean icon_only )
18 {
19 GdkEventClient event;
20 event.type = GDK_CLIENT_EVENT;
21 event.send_event = TRUE;
22 event.window = NULL;
23
24 if( icon_only )
25 event.message_type = gdk_atom_intern("_GTK_LOAD_ICONTHEMES", FALSE);
26 else
27 event.message_type = gdk_atom_intern("_GTK_READ_RCFILES", FALSE);
28
29 event.data_format = 8;
30 gdk_event_send_clientmessage_toall((GdkEvent *)&event);
31 }
32
33 int main (int argc, char *argv[])
34 {
35 GtkWidget *dlg;
36
37 #ifdef ENABLE_NLS
38 bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
39 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
40 textdomain (GETTEXT_PACKAGE);
41 #endif
42
43 gtk_set_locale ();
44 gtk_init (&argc, &argv);
45
46 if( argc >= 3 && strcmp( argv[1], "demo" ) == 0 )
47 {
48 show_demo( (GdkNativeWindow)atoi( argv[2] ) );
49 gtk_main();
50 return 0;
51 }
52
53 dlg = create_dlg ();
54 main_dlg_init( dlg );
55 gtk_widget_show (dlg);
56
57 gtk_main ();
58 return 0;
59 }
60