GTKMM-4.0 app looks like GTKMM-3.0 app

Hello,
I am a c++ programmer with average knowledge in gtkmm. I am developing a little application for my college project and the app is built against gtkmm-4.0 using CMake, but my application looks like a gtk3 application. Here is the image of how it looks

and here is my cmake file

cmake_minimum_required(VERSION 3.10)
set (CMAKE_CXX_STANDARD 20)
project(UIdesign)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTKMM REQUIRED gtkmm-4.0)
pkg_check_modules(GLIBMM REQUIRED glibmm-2.68)
message("Compiler Version: ${CMAKE_CXX_COMPILER_VERSION}")
set(sources 
	${CMAKE_SOURCE_DIR}/src/main.cpp
	${CMAKE_SOURCE_DIR}/src/window.cpp
	${CMAKE_SOURCE_DIR}/src/filehandler.cpp 
)
set(headers
	${CMAKE_SOURCE_DIR}/include/window.h
	${CMAKE_SOURCE_DIR}/include/filehandler.h
)
add_executable(${PROJECT_NAME} ${sources} ${headers})
link_directories(${GTKMM_LIBRARY_DIRS})
link_directories(${GLIBMM_LIBRARY_DIRS})
target_link_libraries(${PROJECT_NAME} ${GTKMM_LIBRARIES})
include_directories(${GTKMM_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${GLIBMM_LIBRARIES})
include_directories(${GLIBMM_INCLUDE_DIRS})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/include)

in cmake file you can see that i linked gtkmm-4.0 using pkg conf
pkg_check_modules(GTKMM REQUIRED gtkmm-4.0)

I also built other project that uses gtkmm-4.0 and that application also looks like gtk3 app and i also provided the Link for downloaded app

Link for my app
My system is endeavour os - arch based distro, with gnome 42

What are you expecting it to look like? The default GTK4 theme looks very similar to GTK3’s Adwaita - see the following screenshot of the demo for an example:

If you want your app to look like a modern GNOME app, you will need to use libadwaita:

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.