-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.c
50 lines (39 loc) · 1.47 KB
/
gui.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
41
42
43
44
45
46
47
48
49
50
#include <gtk/gtk.h>
GtkWidget *g_notebook_widget;
GtkWidget *g_btn_login;
GtkWidget *g_exit_btn;
GtkWidget *g_username_entry;
GtkWidget *g_password_entry;
GtkWidget *g_img1;
GtkWidget *g_log_label;
GtkWidget *g_img2;
GtkWidget *g_create_label;
int main(int argc, char *argv[])
{
GtkBuilder *builder;
GtkWidget *window;
gtk_init(&argc, &argv);
builder = gtk_builder_new();
gtk_builder_add_from_file (builder, "try.glade", NULL);
window = GTK_WIDGET(gtk_builder_get_object(builder, "window"));
gtk_builder_connect_signals(builder, NULL);
g_notebook_widget = GTK_WIDGET(gtk_builder_get_object(builder, "notebook_widget"));
g_btn_login = GTK_WIDGET(gtk_builder_get_object(builder, "btn_login"));
g_exit_btn = GTK_WIDGET(gtk_builder_get_object(builder, "exit_btn"));
g_username_entry = GTK_WIDGET(gtk_builder_get_object(builder, "username_entry"));
g_password_entry = GTK_WIDGET(gtk_builder_get_object(builder, "password_entry"));
g_img1 = GTK_WIDGET(gtk_builder_get_object(builder, "img1"));
g_img2 = GTK_WIDGET(gtk_builder_get_object(builder, "img2"));
g_create_label = GTK_WIDGET(gtk_builder_get_object(builder, "create_label"));
g_log_label = GTK_WIDGET(gtk_builder_get_object(builder, "log_label"));
g_object_unref(builder);
gtk_widget_show(window);
gtk_main();
return 0;
}
G_MODULE_EXPORT void on_window_destroy(){
gtk_main_quit();
}
G_MODULE_EXPORT void on_exit_btn_clicked(){
gtk_main_quit();
}