1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
/*
* main.c
*
* Copyright 2008 warren <wardubmc@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include <stdlib.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "functions.h"
int main(int argc, char **argv)
{
/* Load gtk */
gtk_init(&argc, &argv);
/* Get temp directory */
const gchar *TmpDirectory = g_get_tmp_dir();
/* Show main window */
GtkWidget *pWindow;
pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position(GTK_WINDOW(pWindow), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(pWindow), 800, 450);
gtk_window_set_title(GTK_WINDOW(pWindow), "ET Open Config Generator");
gtk_widget_show(pWindow);
/* Elements */
GError* GtkBuild = NULL;
GtkBuilder* pBuildWindow = gtk_builder_new();
if(pBuildWindow)
{
if(!gtk_builder_add_from_file(pBuildWindow, "MainWindowUI.xml", &GtkBuild))
{
if(GtkBuild)
{
printf("Error Message: %s", GtkBuild -> message);
}
}
GObject *pMainVerticalBox; /* OU GtkWidget?? Je ne sais pas trop! */
pMainVerticalBox = gtk_builder_get_object(pBuildWindow, "vbox1");
gtk_container_add(GTK_CONTAINER(pWindow), GTK_WIDGET(pMainVerticalBox)); /* Est-ce GTK_WIDGEt ou GTK_OBJECT ou rien ou autre chose?? Je ne sais pas! */
}
/* Main */
gtk_main();
return EXIT_SUCCESS;
} |
Partager