Fix TopPanel

This commit is contained in:
daleclack 2022-02-11 16:29:27 +08:00
parent 4d5f83206f
commit 9d302083cb
5 changed files with 17 additions and 3 deletions

View File

@ -1,6 +1,6 @@
set(CMAKE_CXX_STANDARD 17)
cmake_minimum_required(VERSION 3.0.0)
project(My_GtkUi VERSION 2.6.0)
project(My_GtkUi VERSION 2.7.0)
include(CTest)
enable_testing()
@ -32,6 +32,14 @@ add_custom_command(
${GRESOURCE_XML}
--target=${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}
--generate-source
DEPENDS
${CMAKE_SOURCE_DIR}/res/game1.ui
${CMAKE_SOURCE_DIR}/res/title.ui
${CMAKE_SOURCE_DIR}/res/toppanel.ui
${CMAKE_SOURCE_DIR}/res/win_size.ui
${CMAKE_SOURCE_DIR}/res/win1.ui
${CMAKE_SOURCE_DIR}/res/window.ui
${CMAKE_SOURCE_DIR}/res/gtk42.resource.xml
)
# Step 3:

View File

@ -20,6 +20,7 @@
<file preprocess="xml-stripblanks">toppanel.ui</file>
<file preprocess="xml-stripblanks">win_size.ui</file>
<file preprocess="xml-stripblanks">win1.ui</file>
<file preprocess="xml-stripblanks">title.ui</file>
<file preprocess="xml-stripblanks">game1.ui</file>
</gresource>
</gresources>

View File

@ -2,7 +2,7 @@
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkButtonBox">
<object class="GtkButtonBox" id="titlebox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">start</property>

View File

@ -56,4 +56,9 @@ void add_toppanel(GtkBuilder *builder,GtkFixed *fixed){
GObject *window=gtk_builder_get_object(builder,"window");
g_signal_connect_swapped(btn_exit,"clicked",G_CALLBACK(gtk_widget_destroy),window);
gtk_fixed_put(fixed,GTK_WIDGET(panel1),0,0);
//Add Title Panel
GtkBuilder *titlebuilder=gtk_builder_new_from_resource("/gtk42/title.ui");
GObject *titlebox=gtk_builder_get_object(titlebuilder,"titlebox");
gtk_fixed_put(fixed,GTK_WIDGET(titlebox),0,0);
}

View File

@ -11,7 +11,7 @@ void win1_init(GtkWidget *widget,GtkWindow *parent){
gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(window1),logo_sized);
//Add version information
char *version;
version=g_strdup_printf("2.6\nRunning Against Gtk %d.%d.%d",
version=g_strdup_printf("2.7\nRunning Against Gtk %d.%d.%d",
gtk_get_major_version(),
gtk_get_minor_version(),
gtk_get_micro_version());