Add gtk11

This commit is contained in:
daleclack 2020-10-22 19:41:53 +08:00
parent 2c065493dd
commit eed8ef83f5
53 changed files with 116 additions and 28 deletions

View File

@ -1,28 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include<gtk/gtk.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *button;
GtkWidget *image;
gtk_init(&argc,&argv);
window=gtk_window_new(GTK_WINDOW_POPUP);
g_signal_connect(G_OBJECT(window),"destroy",G_CALLBACK(gtk_main_quit),NULL);
gtk_window_set_title(GTK_WINDOW(window),"gtk(5)");
gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(window),400,300);
vbox=gtk_vbox_new(FALSE,0);
gtk_container_add(GTK_CONTAINER(window),vbox);
image=gtk_image_new_from_file("a.png");
gtk_box_pack_start(GTK_BOX(vbox),image,FALSE,FALSE,0);
button=gtk_button_new_with_label("Exit");
g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK(gtk_main_quit),NULL);
gtk_box_pack_start(GTK_BOX(vbox),button,FALSE,FALSE,0);
gtk_widget_show_all(window);
gtk_main();
return 0;
}

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

28
Gtk3/gtk11/Makefile.win Normal file
View File

@ -0,0 +1,28 @@
# Project: gtk11
# Makefile created by Dev-C++ 5.11
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
OBJ = main.o
LINKOBJ = main.o
LIBS = -L"C:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32" -L"C:/Dev-Cpp/gtk+/lib" -static-libgcc -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangocairo-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -m32
INCS = -I"C:/Dev-Cpp/MinGW64/include" -I"C:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/5.1.0/include" -I"C:/Dev-Cpp/gtk+/include/gtk-3.0" -I"C:/Dev-Cpp/gtk+/include/cairo" -I"C:/Dev-Cpp/gtk+/include/pango-1.0" -I"C:/Dev-Cpp/gtk+/include/atk-1.0" -I"C:/Dev-Cpp/gtk+/include/cairo" -I"C:/Dev-Cpp/gtk+/include/pixman-1" -I"C:/Dev-Cpp/gtk+/include" -I"C:/Dev-Cpp/gtk+/include/freetype2" -I"C:/Dev-Cpp/gtk+/include" -I"C:/Dev-Cpp/gtk+/include/libpng15" -I"C:/Dev-Cpp/gtk+/include/gdk-pixbuf-2.0" -I"C:/Dev-Cpp/gtk+/include/libpng15" -I"C:/Dev-Cpp/gtk+/include/glib-2.0" -I"C:/Dev-Cpp/gtk+/lib/glib-2.0/include" -I"C:/Dev-Cpp/gtk+/include/gtk-3.0/gtk"
CXXINCS = -I"C:/Dev-Cpp/MinGW64/include" -I"C:/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/5.1.0/include" -I"C:/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++" -I"C:/Dev-Cpp/gtk+/include/gtk-3.0" -I"C:/Dev-Cpp/gtk+/include/cairo" -I"C:/Dev-Cpp/gtk+/include/pango-1.0" -I"C:/Dev-Cpp/gtk+/include/atk-1.0" -I"C:/Dev-Cpp/gtk+/include/cairo" -I"C:/Dev-Cpp/gtk+/include/pixman-1" -I"C:/Dev-Cpp/gtk+/include" -I"C:/Dev-Cpp/gtk+/include/freetype2" -I"C:/Dev-Cpp/gtk+/include" -I"C:/Dev-Cpp/gtk+/include/libpng15" -I"C:/Dev-Cpp/gtk+/include/gdk-pixbuf-2.0" -I"C:/Dev-Cpp/gtk+/include/libpng15" -I"C:/Dev-Cpp/gtk+/include/glib-2.0" -I"C:/Dev-Cpp/gtk+/lib/glib-2.0/include" -I"C:/Dev-Cpp/gtk+/include/gtk-3.0/gtk"
BIN = gtk11.exe
CXXFLAGS = $(CXXINCS) -m32
CFLAGS = $(INCS) -m32
RM = rm.exe -f
.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)
main.o: main.cpp
$(CPP) -c main.cpp -o main.o $(CXXFLAGS)

62
Gtk3/gtk11/gtk11.dev Normal file
View File

@ -0,0 +1,62 @@
[Project]
FileName=Project1.dev
Name=gtk11
Type=1
Ver=2
ObjFiles=
Includes=
Libs=
PrivateResource=
ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
Linker=
IsCpp=1
Icon=
ExeOutput=
ObjectOutput=
LogOutput=
LogOutputEnabled=0
OverrideOutput=0
OverrideOutputName=Project1.exe
HostApplication=
UseCustomMakefile=0
CustomMakefile=
CommandLine=
Folders=
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=10
CompilerSettings=0000000100000000000000000
UnitCount=1
[VersionInfo]
Major=1
Minor=0
Release=0
Build=0
LanguageID=1033
CharsetID=1252
CompanyName=
FileVersion=1.0.0.0
FileDescription=Developed using the Dev-C++ IDE
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
AutoIncBuildNr=0
SyncProduct=1
[Unit1]
FileName=main.cpp
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

8
Gtk3/gtk11/gtk11.layout Normal file
View File

@ -0,0 +1,8 @@
[Editors]
Order=0
Focused=0
[Editor_0]
CursorCol=20
CursorRow=1
TopLine=1
LeftChar=1

18
Gtk3/gtk11/main.cpp Normal file
View File

@ -0,0 +1,18 @@
#include<gtk/gtk.h>
void hello(GtkWidget *widget,gpointer data){
g_print("%s ",(gchar*)data);
}
int main(int argc,char **argv){
GtkWidget *window;
GtkWidget *button;
char str1[20]="hello";
gtk_init(&argc,&argv);
window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(G_OBJECT(window),"destroy",G_CALLBACK(gtk_main_quit),NULL);
button=gtk_button_new_with_label("print");
gtk_container_add(GTK_CONTAINER(window),button);
g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK(hello),(gpointer)str1);
gtk_widget_show_all(window);
gtk_main();
return 0;
}

BIN
win32/Xeapi.exe Normal file

Binary file not shown.

BIN
win32/xerelease6-x86.exe Normal file

Binary file not shown.

BIN
win32/xerelease6.exe Normal file

Binary file not shown.