-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
40 lines (27 loc) · 1.13 KB
/
main.c
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
#include "application_functions.h"
int main(int argc, char **argv)
{
GtkBuilder *builder;
DATA *app = g_slice_new(DATA);
gtk_init(&argc, &argv);
/* Making necessary initialisations */
app->pixbuffs = g_hash_table_new(g_str_hash,NULL);
app->choose_train.is_revealer_visible = false;
app->dwnld_tic.name = "DOWNLOAD";
app->cancel_tic.name = "CANCEL";
/* Adding css */
GtkCssProvider *css = gtk_css_provider_new();
gtk_css_provider_load_from_resource(css,"/UI/style.css");
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),GTK_STYLE_PROVIDER(css),GTK_STYLE_PROVIDER_PRIORITY_USER);
builder = gtk_builder_new_from_resource("/UI/UI.glade");
get_widgets(builder, app);
get_imgs(builder,app->pixbuffs);
gtk_builder_connect_signals(builder, app);
g_object_unref(builder);
gtk_window_set_icon(GTK_WINDOW(app->win), gdk_pixbuf_new_from_resource_at_scale("/icons/train.svg", 128, 128, TRUE, NULL));
gtk_widget_show(app->win);
/* Create and start loading thread */
pthread_create(&(app->threads.start),NULL,start_load,app);
gtk_main();
return 0;
}