Commit Graph

364 Commits

Author SHA1 Message Date
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
Alexander Mikhaylenko
c2e4e1af73 headerbar: Remove user-settable title
Use window title, or custom title widget if it's set. Remove 'title'
property.

Update demos and tests to set the title on the window instead of
headerbar.
2020-05-01 19:48:05 +05:00
Matthias Clasen
edae2a8dc5 frame: Drop shadow-type
Frames that don't draw frames are not very useful,
so just drop the shadow-type property.
2020-04-17 10:57:36 -04:00
Matthias Clasen
0b17658a82 Replace most uses of <Primary> with <Control>
The only place where we are still using <Primary> is
in tests, to ensure we keep parsing it. Otherwise,
<Control> is now the preferred syntax.
2020-04-06 17:05:52 -04:00
Timm Bäder
0e8850bf84 examples: Add common_cflags to build
And fix all the warnings and errors generated by doing so.

See #2491
2020-03-06 16:36:42 +01:00
Matthias Clasen
b5bacb3be6 Drop the margin property
Replace it with margin-start, -end, -top, -bottom throughout.
2020-02-25 20:59:04 -05:00
Matthias Clasen
c789711652 Stop using gtk_main_quit
Stop using gtk_main and gtk_main_quit in tests and
examples. These APIs are on the way out.
2020-02-09 23:12:32 -05:00
Benjamin Otte
8a60f5dc78 bloatpad: Use a box, not a toolbar 2020-02-07 14:08:08 +01:00
Matthias Clasen
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Matthias Clasen
302d2a04ae Stop using gtk_widget_get_surface
Replace all uses of gtk_widget_get_surface by
gtk_native_get_surface.
2019-05-28 20:25:16 +00:00
Matthias Clasen
f950172731 Remove a few stray <packing/> elements
These were leftovers from an earlier conversion
that did not properly strip empty elements.
2019-04-05 20:52:29 -04:00
Emmanuele Bassi
ecc4c4f368 examples: Update GtkGrid definitions in UI files 2019-04-05 00:15:51 +01:00
Matthias Clasen
7ac250dea7 Convert all ui files
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-27 13:36:24 -04:00
Matthias Clasen
9e0c471b03 entry, spin button: Drop redundant API
Avoid duplicating GtkEditable APIs. Port existing users.
2019-02-28 16:34:00 -05:00