Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=grape.git;a=commitdiff;h=ca4ce51598ff36ca88f472dc5f0669b16f087f09
commit ca4ce51598ff36ca88f472dc5f0669b16f087f09 Author: James Buren <[email protected]> Date: Mon Apr 12 12:25:54 2010 -0500 ui.c/ui.h * initial draft diff --git a/src/ui.c b/src/ui.c new file mode 100644 index 0000000..e3da792 --- /dev/null +++ b/src/ui.c @@ -0,0 +1,48 @@ +//[of]:license +/* + * Copyright (c) 2010 James Buren + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +//[cf] +//[of]:includes +#include "ui.h" +//[cf] +//[of]:functions +//[of]:box_pack_widgets +/* Pack GtkWidgets into a GtkBox. Uses pairs (GtkWidget *,gboolean). */ +static void box_pack_widgets(GtkWidget *box,...) { + va_list args; + GtkWidget *child; + gboolean expand; + + va_start(args,box); + + while((child = va_arg(args,GtkWidget *))) { + + expand = va_arg(args,gboolean); + + gtk_box_pack_start(GTK_BOX(box),child,expand,TRUE,0); + + } + + va_end(args); +} +//[cf] +//[cf] diff --git a/src/ui.h b/src/ui.h new file mode 100644 index 0000000..c262efb --- /dev/null +++ b/src/ui.h @@ -0,0 +1,29 @@ +//[of]:license +/* + * Copyright (c) 2010 James Buren + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +//[cf] +//[of]:header +#ifndef _ui_header_ +#define _ui_header_ +#include <gtk/gtk.h> +#endif +//[cf] _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
