ui_main_screen.c 1.48 KB
Newer Older
Cedric Roux's avatar
 
Cedric Roux committed
1
2
3
4
5
6
7
8
9
10
11

#if HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdio.h>
#include <stdint.h>
#include <string.h>

#include <gtk/gtk.h>

12
#include "rc.h"
Cedric Roux's avatar
 
Cedric Roux committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

#include "ui_interface.h"
#include "ui_main_screen.h"
#include "ui_menu_bar.h"
#include "ui_tree_view.h"
#include "ui_notebook.h"
#include "ui_notifications.h"

ui_main_data_t ui_main_data;

int ui_gtk_initialize(int argc, char *argv[])
{
    GtkWidget *vbox;

    memset(&ui_main_data, 0, sizeof(ui_main_data_t));

    /* Create the main window */
30
    ui_main_data.window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
Cedric Roux's avatar
 
Cedric Roux committed
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

    gtk_window_set_position(GTK_WINDOW(ui_main_data.window), GTK_WIN_POS_CENTER);
    gtk_window_set_default_size(GTK_WINDOW(ui_main_data.window), 1024, 800);
#if defined(PACKAGE_STRING)
    gtk_window_set_title(GTK_WINDOW(ui_main_data.window), PACKAGE_STRING);
#else
    gtk_window_set_title(GTK_WINDOW(ui_main_data.window), "itti debugger");
#endif
    gtk_window_set_resizable(GTK_WINDOW(ui_main_data.window), TRUE);

    vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);

    CHECK_FCT(ui_menu_bar_create(vbox));
    CHECK_FCT(ui_toolbar_create(vbox));
//     CHECK_FCT(ui_tree_view_create(ui_main_data.window, vbox));
    CHECK_FCT(ui_notebook_create(vbox));

    gtk_container_add(GTK_CONTAINER(ui_main_data.window), vbox);
    /* Assign the destroy event */
    g_signal_connect(ui_main_data.window, "destroy", G_CALLBACK (gtk_main_quit), NULL);

    /* Show the application window */
    gtk_widget_show_all (ui_main_data.window);

    return RC_OK;
}