Commit Graph

377 Commits

Author SHA1 Message Date
Matthias Clasen
9f068866e2 examples: Use #pragma once consistently
It is our current coding style.
2023-12-20 10:29:45 -05:00
Matthias Clasen
ce4fbcef8e examples: More deprecation cleanup
Remove GtkDialog use from bloatpad.
2023-08-04 09:47:49 -04:00
Matthias Clasen
7c8171f069 Drop old style deprecation handling
We don't use this anymore.
2023-08-04 08:38:55 -04:00
Matthias Clasen
33fe93d9f2 examples: Deprecation cleanup 2023-08-04 08:38:00 -04:00
Emmanuele Bassi
1ad4c04b2a Replace deprecated CSS loading API
Use gtk_css_provider_load_from_string() when loading CSS from C
strings.
2023-05-16 16:59:05 -04:00
Matthias Clasen
05f488011a Add a README to examples/hello
Just so nobody wonders why there's a meson.build
in this subdirectory.
2023-05-13 21:56:29 -04:00
Matthias Clasen
7d4c757c58 examples: Update for deprecations
Stop using gdk_surface_create_similar_surface here.
2023-04-02 09:06:02 -04:00
William Roy
aaeec84d75 Fix compile_resources present source directory
In certain scenarios, address the issue where gnome.compile_resources 
fails to transmit the present source directory. This is most notably 
visible with MSBuild.
2023-03-07 21:59:50 +00:00
Matthias Clasen
d43968f7b6 Fix a deprecation warning 2023-02-02 09:03:26 +01:00
Matthias Clasen
b8962fcba7 examples: Stop using gtk_widget_show/hide 2022-12-13 13:46:02 -05:00
Matthias Clasen
9948053cd7 Deprecate GtkDialog
GtkDialog is too flexible in terms of UI (headerbars vs action bar,
etc), and has archaic APIs. It is time to retire it.
2022-10-29 15:27:53 -04:00
Matthias Clasen
8bee62dd36 examples: Port to async dialog API 2022-10-29 13:31:41 -04:00
Matthias Clasen
6f3613a06f bloatpad: Stop using a combobox
Replace GtkComboBoxText with GtkDropDown+GtkStringList.
2022-10-21 22:03:17 -04:00
Matthias Clasen
6efb18330f demos and examples: Ignore deprecations
For now, just ignore deprecations. Eventually,
we will have to go through, drop demos that are
for wholly deprecated widgets, and update others.
2022-10-11 17:18:21 -04:00
Benjamin Otte
0428d8ccd6 examples: Use textures over pixbufs 2021-09-17 04:31:46 +02:00
Matthias Clasen
873f6ccfea Add a simple Javascript example
This shows how to use a layout manager in a widget,
implemented in javascript. The example sets up the
environment for running from the toplevel dir, assuming
that the build dir is called 'build'.
2021-07-05 13:48:51 -04:00
Matthias Clasen
7f2648a013 Cosmetics
Amend LD_PRELOAD instead of replacing it, so you can just
point it at the right libgtk-4.so while running squares.py
from elsewhere.
2021-07-03 09:10:27 -04:00
Matthias Clasen
ed5b42071c Add a simple python example
This shows how to do custom drawing in a widget,
implemented in python. The example sets up the
environment for running from the toplevel dir,
assuming that the build dir is called 'build'.
2021-07-02 21:31:32 -04:00
Matthias Clasen
bda7557783 Update hello-world.c
Simplify the code a bit and make the window
match the existing screenshot.
2021-06-29 08:01:37 -04:00
Matthias Clasen
df1116a010 bloatpad: Add icons as resources
This can serve as a useful example for how to add
themed icons as resources.
2021-06-16 09:35:00 -04:00
Matthias Clasen
11916bac7e bloatpad: Give the toolbar a facelift
Make it look more like a toolbar.
2021-06-16 09:26:15 -04:00
Matthias Clasen
d675ae5cc5 bloatpad: Improve accel dialog
Make this dialog a bit less of an eyesore.
2021-06-16 09:09:24 -04:00
Matthias Clasen
43eeff8f15 examples: Use existing icons
The sunny icon doesn't exist anymore.
2021-06-16 08:45:04 -04:00
Matthias Clasen
ece9e7e240 examples: Drop a redundant frame
The frame in the drawing example adds nothing
and looks wrong.
2021-06-16 08:40:01 -04:00
Matthias Clasen
06caa57f9a Make a standalone hello world
We want to test building against the installed GTK
in ci, so lets add a standalone project.
2021-06-08 17:41:11 -04:00
Matthias Clasen
46d1f04a7c bloatpad: Bring back the menubar
This was lost at some point.
2021-06-05 08:49:17 -04:00
Matthias Clasen
b86153cee3 Remove a forgotten file
The example series only has 9 steps now. Remove remnants
of step 10.
2021-01-31 20:26:02 -05:00
Matthias Clasen
9b056f57f7 examples: Remove requires from ui files
No need to check requires for things that are shipped
with GTK.
2020-11-10 18:38:54 -05:00
Emmanuele Bassi
7ac6e25ffc Use GtkApplication in the examples
Some people read the "Getting Started" section as a series of
incremental lessons, and having the examples go from GtkApplication to
the old style "init / spin the main loop" confuses them.

We should be using GtkApplication everywhere in our examples.
2020-10-21 22:44:53 +01:00
Matthias Clasen
2c5c938f0d Clean up uses of gtk_toggle_button_get/set_active
Replace all uses on check buttons by the corresponding
check button api.
2020-08-30 21:23:25 -04:00
Matthias Clasen
e694a4137c examples: Fix multiple small problems
Add a paragraph about running the example apps
uninstalled in the README, and verify that the
standalone Makefiles actually work. Hint: some
didn't.
2020-08-13 17:30:47 -04:00
Matthias Clasen
ed13e6a41e grid layout: Rename some properties
Rename GtkGridLayoutChild:left-attach/top-attach to
GtkGridLayoutChild:column/row. Update all users.

Fixes: #2967
2020-08-02 17:58:03 -04:00
Benjamin Otte
3078b180fe Replace "gdouble" with "double" 2020-07-25 00:47:36 +02:00
Benjamin Otte
d375dce9f5 Replace "gchar" with "char" 2020-07-25 00:47:36 +02:00
Benjamin Otte
d7266b25ba Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
Alexander Mikhaylenko
7c3b30036e headerbar: Show title buttons by default
Most of the time show-title-buttons is set to TRUE. Go ahead and make that
the default.
2020-07-02 23:51:16 +05:00
Matthias Clasen
386b63b85d scrolledwindow: Don't take adjustments in new()
In 99.9% of all cases, these are just NULL, NULL.
So just do away with these arguments, people can
use the setters for the rare cases where they want
the scrolled window to use a different adjustment.
2020-06-24 11:25:09 -04:00
Matthias Clasen
6c31092c69 examples: Stop using appmenu apis
The appmenu-related GtkApplication apis are going away.
2020-05-22 17:31:05 -04:00
Timm Bäder
17c7662a6c bloatpad: Pass common_cflags to the build 2020-05-19 08:32:33 +02:00
Timm Bäder
afd56517d1 bloatpad: Avoid a few theoretical compiler warnings 2020-05-18 11:30:08 +02:00
Timm Bäder
4b655ecd36 examples: Add common_cflags to executables 2020-05-18 11:30:08 +02:00
Matthias Clasen
2a24b8c653 Replace most remaining uses of container api
These are all on GtkBox or enumerating children.
2020-05-11 22:38:21 -04:00
Matthias Clasen
cd0081d08a Use gtk_window_destroy
Replace calls to gtk_widget_destroy on windows
with gtk_window_destroy.
2020-05-11 12:20:57 -04:00
Matthias Clasen
d2430c70bd Refresh the tutorial examples
Redo this series of examples from 2013, and adapt it to modern
way of doing things. The biggest differences are that we use
a headerbar right from the start, and don't mention the app
menu.

Fixes: #2730
2020-05-11 08:15:56 -04:00
Matthias Clasen
b21a027d10 examples: Use GtkDrawingArea::resize
This signal is a replacement for this (ab)use
of the ::size-allocate signal, which is going away.
2020-05-06 14:27:45 -04:00
Matthias Clasen
77af8e303d Use gtk_overlay_set_child throughout
Replace all uses of gtk_container_add on overlays
by gtk_overlay_set_child.
2020-05-04 22:53:08 -04:00
Matthias Clasen
99ef14b59f Use gtk_search_bar_set_child throughout 2020-05-04 22:53:08 -04:00
Matthias Clasen
f59f355190 Use gtk_window_set_child throughout
Replace all uses of gtk_container_add on windows
by gtk_window_set_child.
2020-05-04 22:53:08 -04:00
Matthias Clasen
67759d4c3e Use gtk_scrolled_window_set_child throughout
Replace all uses of gtk_container_add on popovers
by gtk_scrolled_window_set_child.
2020-05-04 22:53:07 -04:00
Matthias Clasen
1706b80815 Use gtk_frame_set_child throughout
Replace all uses of gtk_container_add for
frames with gtk_frame_set_child.
2020-05-04 17:01:18 -04:00