Add gtk63
This commit is contained in:
parent
8d4ea3008c
commit
1296058d2d
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Linux",
|
||||||
|
"includePath": [
|
||||||
|
//This is the gtk4 config file on vscode
|
||||||
|
//Due to no gtk4 on debian and ubuntu till now,the configure only support manjaro(Arch linux may can use it)
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"/usr/include/gtk-4.0/**",
|
||||||
|
"/usr/include/pango-1.0/**",
|
||||||
|
"/usr/include/glib-2.0/**",
|
||||||
|
"/usr/lib/glib-2.0/include/**",
|
||||||
|
"/usr/include/harfbuzz/**",
|
||||||
|
"/usr/include/freetype2/**",
|
||||||
|
"/usr/include/libpng16/**",
|
||||||
|
"/usr/include/libmount/**",
|
||||||
|
"/usr/include/blkid/**",
|
||||||
|
"/usr/include/fribidi/**",
|
||||||
|
"/usr/include/cairo/**",
|
||||||
|
"/usr/include/lzo/**",
|
||||||
|
"/usr/include/pixman-1/**",
|
||||||
|
"/usr/include/gdk-pixbuf-2.0/**",
|
||||||
|
"/usr/include/graphene-1.0/**",
|
||||||
|
"/usr/lib/graphene-1.0/include/**",
|
||||||
|
"/usr/include/gio-unix-2.0/**"
|
||||||
|
],
|
||||||
|
"defines": [],
|
||||||
|
"compilerPath": "/usr/bin/gcc",
|
||||||
|
"cStandard": "gnu17",
|
||||||
|
"cppStandard": "gnu++14",
|
||||||
|
"intelliSenseMode": "gcc-arm64",
|
||||||
|
"compilerArgs": [
|
||||||
|
"`pkg-config --cflags --libs gtk+-3.0`"
|
||||||
|
],
|
||||||
|
"configurationProvider": "ms-vscode.cmake-tools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "g++ - Build and debug active file",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/bin/gtk63-gtk4",
|
||||||
|
"args": [],
|
||||||
|
"stopAtEntry": false,
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"environment": [],
|
||||||
|
"externalConsole": false,
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preLaunchTask": "C/C++: g++ build active file",
|
||||||
|
"miDebuggerPath": "/usr/bin/gdb"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"C_Cpp.errorSquiggles": "Disabled",
|
||||||
|
"cmake.configureOnOpen": false
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
{
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"type": "cppbuild",
|
||||||
|
"label": "C/C++: g++ build active file",
|
||||||
|
"command": "/usr/bin/g++",
|
||||||
|
"args": [
|
||||||
|
"-g",
|
||||||
|
"src/*.cpp",
|
||||||
|
"-o",
|
||||||
|
"${workspaceFolder}/bin/gtk63-gtk4",
|
||||||
|
"-pthread",
|
||||||
|
"-I${workspaceFolder}/",
|
||||||
|
"-I/usr/include/gtk-4.0",
|
||||||
|
"-I/usr/include/pango-1.0",
|
||||||
|
"-I/usr/include/glib-2.0",
|
||||||
|
"-I/usr/lib/glib-2.0/include",
|
||||||
|
"-I/usr/include/harfbuzz",
|
||||||
|
"-I/usr/include/freetype2",
|
||||||
|
"-I/usr/include/libpng16",
|
||||||
|
"-I/usr/include/libmount",
|
||||||
|
"-I/usr/include/blkid",
|
||||||
|
"-I/usr/include/fribidi",
|
||||||
|
"-I/usr/include/cairo",
|
||||||
|
"-I/usr/include/lzo",
|
||||||
|
"-I/usr/include/pixman-1",
|
||||||
|
"-I/usr/include/gdk-pixbuf-2.0",
|
||||||
|
"-I/usr/include/graphene-1.0",
|
||||||
|
"-I/usr/lib/graphene-1.0/include",
|
||||||
|
"-I/usr/include/gio-unix-2.0",
|
||||||
|
"-mfpmath=sse",
|
||||||
|
"-msse",
|
||||||
|
"-msse2",
|
||||||
|
"-lgtk-4",
|
||||||
|
"-lpangocairo-1.0",
|
||||||
|
"-lpango-1.0",
|
||||||
|
"-lharfbuzz",
|
||||||
|
"-lgdk_pixbuf-2.0",
|
||||||
|
"-lcairo-gobject",
|
||||||
|
"-lcairo",
|
||||||
|
"-lvulkan",
|
||||||
|
"-lgraphene-1.0",
|
||||||
|
"-lgio-2.0",
|
||||||
|
"-lgobject-2.0",
|
||||||
|
"-lglib-2.0"
|
||||||
|
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}"
|
||||||
|
},
|
||||||
|
"problemMatcher": [
|
||||||
|
"$gcc"
|
||||||
|
],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"detail": "Task generated by Debugger."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": "2.0.0"
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
glib-compile-resources gtk39.resource.xml --target=../src/resources.cpp --generate-source
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<gresources>
|
||||||
|
<gresource prefix="gtk39">
|
||||||
|
<file>icon.jpg</file>
|
||||||
|
<file preprocess="xml-stripblanks">window.ui</file>
|
||||||
|
</gresource>
|
||||||
|
</gresources>
|
Binary file not shown.
After Width: | Height: | Size: 93 KiB |
|
@ -0,0 +1,207 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk" version="4.0"/>
|
||||||
|
<object class="GtkAdjustment" id="adjustment1">
|
||||||
|
<property name="upper">100</property>
|
||||||
|
<property name="step-increment">1</property>
|
||||||
|
<property name="page-increment">10</property>
|
||||||
|
</object>
|
||||||
|
<object class="GtkAdjustment" id="adjustment2">
|
||||||
|
<property name="upper">5</property>
|
||||||
|
<property name="step-increment">1</property>
|
||||||
|
<property name="page-increment">10</property>
|
||||||
|
</object>
|
||||||
|
<object class="GtkAdjustment" id="adjustment3">
|
||||||
|
<property name="upper">100</property>
|
||||||
|
<property name="step-increment">1</property>
|
||||||
|
<property name="page-increment">10</property>
|
||||||
|
</object>
|
||||||
|
<object class="GtkWindow" id="window">
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="child">
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">20</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScale" id="scale1">
|
||||||
|
<property name="draw-value">1</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="adjustment">adjustment1</property>
|
||||||
|
<property name="round-digits">1</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="hexpand">1</property>
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">10</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScale" id="scale2">
|
||||||
|
<property name="draw-value">1</property>
|
||||||
|
<property name="adjustment">adjustment1</property>
|
||||||
|
<property name="round-digits">1</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrollbar">
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="adjustment">adjustment1</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCheckButton" id="btnshow">
|
||||||
|
<property name="label" translatable="yes">Display Value on scale widgets</property>
|
||||||
|
<property name="active">1</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="vexpand">1</property>
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="spacing">10</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="label" translatable="yes">Scale Value Position:</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="hexpand">1</property>
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkComboBoxText" id="combo_pos">
|
||||||
|
<property name="halign">center</property>
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="active">0</property>
|
||||||
|
<items>
|
||||||
|
<item>Top</item>
|
||||||
|
<item>Bottom</item>
|
||||||
|
<item>Left</item>
|
||||||
|
<item>Right</item>
|
||||||
|
</items>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="spacing">10</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="label" translatable="yes">Scale Update Policy:</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkComboBoxText" id="combo_update">
|
||||||
|
<property name="halign">center</property>
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="active">1</property>
|
||||||
|
<items>
|
||||||
|
<item>Continuous</item>
|
||||||
|
<item>Discontinuous</item>
|
||||||
|
<item>Delayed</item>
|
||||||
|
</items>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="label" translatable="yes">Scale Digits:</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScale" id="digit_scale">
|
||||||
|
<property name="hexpand">1</property>
|
||||||
|
<property name="draw-value">1</property>
|
||||||
|
<property name="adjustment">adjustment2</property>
|
||||||
|
<property name="round-digits">1</property>
|
||||||
|
<property name="digits">0</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="can-focus">0</property>
|
||||||
|
<property name="label" translatable="yes">Scrollbar page size:</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScale" id="size_scale">
|
||||||
|
<property name="hexpand">1</property>
|
||||||
|
<property name="draw-value">1</property>
|
||||||
|
<property name="adjustment">adjustment3</property>
|
||||||
|
<property name="round-digits">0</property>
|
||||||
|
<property name="digits">0</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="btnexit">
|
||||||
|
<property name="label" translatable="yes">Exit</property>
|
||||||
|
<property name="receives-default">1</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</interface>
|
|
@ -0,0 +1,333 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.38.2 -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.24"/>
|
||||||
|
<object class="GtkAdjustment" id="adjustment1">
|
||||||
|
<property name="upper">100</property>
|
||||||
|
<property name="step-increment">1</property>
|
||||||
|
<property name="page-increment">10</property>
|
||||||
|
</object>
|
||||||
|
<object class="GtkAdjustment" id="adjustment2">
|
||||||
|
<property name="upper">5</property>
|
||||||
|
<property name="step-increment">1</property>
|
||||||
|
<property name="page-increment">10</property>
|
||||||
|
</object>
|
||||||
|
<object class="GtkAdjustment" id="adjustment3">
|
||||||
|
<property name="upper">100</property>
|
||||||
|
<property name="step-increment">1</property>
|
||||||
|
<property name="page-increment">10</property>
|
||||||
|
</object>
|
||||||
|
<object class="GtkWindow" id="window">
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">20</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScale" id="scale1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="adjustment">adjustment1</property>
|
||||||
|
<property name="round-digits">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">10</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScale" id="scale2">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="adjustment">adjustment1</property>
|
||||||
|
<property name="round-digits">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrollbar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="adjustment">adjustment1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCheckButton" id="btnshow">
|
||||||
|
<property name="label" translatable="yes">Display Value on scale widgets</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">False</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
<property name="draw-indicator">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="spacing">10</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Scale Value Position:</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButtonBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="layout-style">end</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkComboBoxText" id="combo_pos">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="active">0</property>
|
||||||
|
<items>
|
||||||
|
<item>Top</item>
|
||||||
|
<item>Bottom</item>
|
||||||
|
<item>Left</item>
|
||||||
|
<item>Right</item>
|
||||||
|
</items>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="pack-type">end</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="spacing">10</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Scale Update Policy:</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkComboBoxText" id="combo_update">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="active">1</property>
|
||||||
|
<items>
|
||||||
|
<item>Continuous</item>
|
||||||
|
<item>Discontinuous</item>
|
||||||
|
<item>Delayed</item>
|
||||||
|
</items>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="pack-type">end</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Scale Digits:</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScale" id="digit_scale">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="adjustment">adjustment2</property>
|
||||||
|
<property name="round-digits">1</property>
|
||||||
|
<property name="digits">0</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">4</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Scrollbar page size:</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScale" id="size_scale">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="adjustment">adjustment3</property>
|
||||||
|
<property name="round-digits">0</property>
|
||||||
|
<property name="digits">0</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">5</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="btnexit">
|
||||||
|
<property name="label" translatable="yes">Exit</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">6</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
|
@ -0,0 +1,97 @@
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
/*void change_update(GtkWidget *widget,GtkBuilder *builder){
|
||||||
|
//Get scale widgets
|
||||||
|
GObject *scale1=gtk_builder_get_object(builder,"scale1");
|
||||||
|
GObject *scale2=gtk_builder_get_object(builder,"scale2");
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
void show_value(GtkWidget *widget,GtkBuilder *builder){
|
||||||
|
//Get scale widgets
|
||||||
|
GObject *scale1=gtk_builder_get_object(builder,"scale1");
|
||||||
|
GObject *scale2=gtk_builder_get_object(builder,"scale2");
|
||||||
|
//Get checkbutton status and set scale widgets
|
||||||
|
//gboolean checked=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
|
||||||
|
gboolean checked=gtk_check_button_get_active((GtkCheckButton*)widget);
|
||||||
|
gtk_scale_set_draw_value(GTK_SCALE(scale1),checked);
|
||||||
|
gtk_scale_set_draw_value(GTK_SCALE(scale2),checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
void change_pos(GtkWidget *widget,GtkBuilder *builder){
|
||||||
|
//Get scale widgets
|
||||||
|
GObject *scale1=gtk_builder_get_object(builder,"scale1");
|
||||||
|
GObject *scale2=gtk_builder_get_object(builder,"scale2");
|
||||||
|
//Get selection and set the value position
|
||||||
|
gint pos=gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
|
||||||
|
//g_print("%d\n",pos);
|
||||||
|
GtkPositionType position;
|
||||||
|
switch(pos){
|
||||||
|
case 0:
|
||||||
|
position=GTK_POS_TOP;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
position=GTK_POS_BOTTOM;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
position=GTK_POS_LEFT;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
position=GTK_POS_RIGHT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
gtk_scale_set_value_pos(GTK_SCALE(scale1),position);
|
||||||
|
gtk_scale_set_value_pos(GTK_SCALE(scale2),position);
|
||||||
|
}
|
||||||
|
|
||||||
|
void change_digit(GtkWidget *widget,GtkBuilder *builder){
|
||||||
|
//Get scale widgets
|
||||||
|
GObject *scale1=gtk_builder_get_object(builder,"scale1");
|
||||||
|
GObject *scale2=gtk_builder_get_object(builder,"scale2");
|
||||||
|
gint digits=gtk_range_get_value(GTK_RANGE(widget));
|
||||||
|
//Set the scale digits
|
||||||
|
gtk_scale_set_digits(GTK_SCALE(scale1),digits);
|
||||||
|
gtk_scale_set_digits(GTK_SCALE(scale2),digits);
|
||||||
|
}
|
||||||
|
|
||||||
|
void page_size(GtkWidget *widget,GtkBuilder *builder){
|
||||||
|
GObject *set=gtk_builder_get_object(builder,"adjustment1");
|
||||||
|
gdouble page_size;
|
||||||
|
page_size=gtk_range_get_value(GTK_RANGE(widget));
|
||||||
|
gtk_adjustment_set_page_size(GTK_ADJUSTMENT(set),page_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void gtkmain(GtkApplication *app,gpointer user_data){
|
||||||
|
//Main window
|
||||||
|
GtkBuilder *builder=gtk_builder_new_from_resource("/gtk39/window.ui");
|
||||||
|
GObject *window=gtk_builder_get_object(builder,"window");
|
||||||
|
GdkPixbuf *pixbuf=gdk_pixbuf_new_from_resource("/gtk39/icon.jpg",NULL);
|
||||||
|
//gtk_window_set_icon(GTK_WINDOW(window),pixbuf);
|
||||||
|
gtk_window_set_icon_name(GTK_WINDOW(window),"org.gtk.daleclack");
|
||||||
|
gtk_application_add_window(app,GTK_WINDOW(window));
|
||||||
|
//Show value setting
|
||||||
|
GObject *btn_show=gtk_builder_get_object(builder,"btnshow");
|
||||||
|
g_signal_connect(btn_show,"toggled",G_CALLBACK(show_value),builder);
|
||||||
|
//Update policy settings,Gtk3 deprecated
|
||||||
|
|
||||||
|
//Scale Value Position Settings
|
||||||
|
GObject *combo_pos=gtk_builder_get_object(builder,"combo_pos");
|
||||||
|
g_signal_connect(combo_pos,"changed",G_CALLBACK(change_pos),builder);
|
||||||
|
//Scale Digits settings
|
||||||
|
GObject *digit_scale=gtk_builder_get_object(builder,"digit_scale");
|
||||||
|
g_signal_connect(digit_scale,"value-changed",G_CALLBACK(change_digit),builder);
|
||||||
|
//Scroll bar page setting
|
||||||
|
GObject *size_scale=gtk_builder_get_object(builder,"size_scale");
|
||||||
|
g_signal_connect(size_scale,"value-changed",G_CALLBACK(page_size),builder);
|
||||||
|
//"Exit" button
|
||||||
|
GObject *btn_exit=gtk_builder_get_object(builder,"btnexit");
|
||||||
|
g_signal_connect_swapped(btn_exit,"clicked",G_CALLBACK(gtk_window_destroy),window);
|
||||||
|
gtk_widget_show(GTK_WIDGET(window));
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc,char *argv[]){
|
||||||
|
GtkApplication *app;
|
||||||
|
app=gtk_application_new("org.gtk.daleclack",G_APPLICATION_FLAGS_NONE);
|
||||||
|
g_signal_connect(app,"activate",G_CALLBACK(gtkmain),NULL);
|
||||||
|
return g_application_run(G_APPLICATION(app),argc,argv);
|
||||||
|
}
|
Binary file not shown.
Loading…
Reference in New Issue