Main Page | Compound List | File List | Compound Members | File Members

rcc-gtk-config.c File Reference

#include <stdio.h>
#include <string.h>
#include <gtk/gtk.h>
#include <librcc.h>
#include <librccui.h>

Functions

int main (int argc, char *argv[])

Function Documentation

int main int  argc,
char *  argv[]
 

00035 {
00036     unsigned int i;
00037     unsigned char all_mode = 0;
00038     GtkWidget *window1;
00039     GtkWidget *save, *close, *hbox;
00040     GtkWidget *box;
00041     
00042     
00043     for (i=1;i<argc;i++) {
00044         if (!strcmp(argv[i],"--all")) all_mode = 1;
00045         else if (!strcmp(argv[i], "--")) break;
00046         else if ((!config)&&(strncmp(argv[i],"-",1))) config = argv[i];
00047     }
00048     if (i==1)
00049         printf("Usage: rcc-config [ --all ] [ <config name> ]\n");
00050 
00051     gtk_set_locale ();
00052     gtk_init (&argc, &argv);
00053 
00054     rccInit();
00055     rccUiInit();
00056     ctx = rccCreateContext(NULL, 0, 0, classes, 0);
00057     rccLoad(ctx, config);
00058     uictx = rccUiCreateContext(ctx);
00059     if (all_mode) rccUiUnHideOption(uictx, RCC_OPTION_ALL);
00060 
00061     window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
00062     gtk_window_set_policy(GTK_WINDOW (window1), FALSE, FALSE, TRUE);
00063     gtk_window_set_title (GTK_WINDOW (window1), "LibRCC Config");
00064     gtk_window_set_wmclass (GTK_WINDOW(window1), "librcc", "libRCC");
00065     gtk_widget_show(window1);
00066     
00067     box = rccUiGetPage(uictx, NULL);
00068     gtk_widget_show (box);
00069     gtk_container_add (GTK_CONTAINER (window1), box);
00070 
00071     hbox = gtk_hbox_new (TRUE, 0);
00072     gtk_widget_show (hbox);
00073     gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, 0);
00074 
00075     close = gtk_button_new_with_label("Close");
00076     gtk_widget_show (close);
00077     gtk_signal_connect (GTK_OBJECT (window1), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
00078     gtk_signal_connect (GTK_OBJECT (close), "clicked", GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
00079     gtk_box_pack_start (GTK_BOX (hbox), close, FALSE, FALSE, 0);
00080 
00081     save = gtk_button_new_with_label("Save");
00082     gtk_widget_show (save);
00083     gtk_signal_connect(GTK_OBJECT(save), "clicked", GTK_SIGNAL_FUNC(apply_cb), NULL);
00084     gtk_box_pack_start (GTK_BOX (hbox), save, FALSE, FALSE, 0);
00085 
00086     gtk_main ();
00087 
00088     rccUiFreeContext(uictx);
00089     rccFreeContext(ctx);
00090     rccUiFree();
00091     rccFree();
00092 
00093     return 0;
00094 }


Generated on Thu Aug 11 01:55:30 2005 for LibRCC by doxygen 1.3.3