Update gtk20

This commit is contained in:
daleclack 2020-11-25 21:37:40 +08:00
parent 8b6a712b38
commit 1dd8c9b296
3 changed files with 16 additions and 2 deletions

5
Gtk3/gtk20/gtk20.depend Normal file
View File

@ -0,0 +1,5 @@
# depslib dependency file v1.0
1606308880 source:/sdcard/testing-repository/Gtk3/gtk20/main.cpp
<gtk/gtk.h>
<stdio.h>

View File

@ -4,7 +4,10 @@
<ActiveTarget name="Debug" />
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="41" topLine="0" />
<Cursor1 position="1319" topLine="24" />
</Cursor>
<Folding>
<Collapse line="3" />
</Folding>
</File>
</CodeBlocks_layout_file>

View File

@ -30,9 +30,15 @@ void activate(GtkApplication *app,gpointer user_data){
//Create a button with label
GtkWidget *button=gtk_button_new_with_label("Print");
gtk_widget_set_size_request(button,100,50);
gtk_fixed_put(GTK_FIXED(fixed),button,150,100);
gtk_fixed_put(GTK_FIXED(fixed),button,75,100);
g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK(entry_activate),(gpointer)entry);
//Create a Exit button
GtkWidget *button_exit=gtk_button_new_with_label("Exit");
gtk_widget_set_size_request(button_exit,100,50);
gtk_fixed_put(GTK_FIXED(fixed),button_exit,225,100);
g_signal_connect(G_OBJECT(button_exit),"clicked",G_CALLBACK(gtk_main_quit),NULL);
//Add everything to window
gtk_container_add(GTK_CONTAINER(window),fixed);
gtk_widget_show_all(window);