Commit Graph

34 Commits

Author SHA1 Message Date
Mohammed Sadiq
47872e5172 examples: Use icon-name property to set button icons
Gtk4 added an icon-name property for GtkButton.
2018-05-09 15:28:28 +05:30
Mohammed Sadiq
88ddda6d60 examples: Remove explicit gtk_widget_show()
In gtk4, widgets are visible by default.
2018-05-09 15:27:55 +05:30
Mohammed Sadiq
8fcc401e05 examples: Take advantage of user_data passed
The last parameter of the signal callback from .ui
is the template's object from which the class is
derived.

And so, we already have access to the window object.
Let's just use it.
2018-05-08 18:55:48 +05:30
Mohammed Sadiq
bf1c344443 examples: Don't use private members for final classes
Only derivable classes are required to have private members
so that derived classes can't override them.
2018-05-08 14:34:43 +05:30
Mohammed Sadiq
772c994fd0 examples: Simplify .ui files
Run gtk4-builder-tool recursively
2018-05-07 22:30:40 +05:30
Mohammed Sadiq
c5976fed9a examples: Fix Makefiles to use gtk4 for build 2018-05-07 22:29:32 +05:30
Matthias Clasen
2301d8d90b enums: Change GtkIconSize values
The new values are the ones we intend to keep. The old ones had
duplicated meanings and nobody knew which one to take.
2017-11-15 14:22:17 -05:00
Emmanuele Bassi
391d1a04ec Drop Autotools build
We are officially switching to Meson as the default build system for
GTK+.
2017-08-14 22:23:09 +01:00
Tim-Philipp Müller
3ac88fa6b6 meson: examples: update
Mostly style changes. Don't create resource source files
with spaces in them, that's tempting our luck.
2017-05-03 15:10:53 +01:00
Timm Bäder
8ae847e4fc Build examples 2017-05-03 15:10:52 +01:00
Alexander Larsson
723b588b5d Make gdk.la and gsk.la a noninst helper library
This merged gtk, gdk and gsk into one library, making it possible to
have internal private APIs between gtk them, as well as producing more
efficient code.

https://bugzilla.gnome.org/show_bug.cgi?id=773100
2016-10-26 16:34:15 +02:00
Matthias Clasen
d053d5c58f Rename Makefile references from 3.0 to 4.0
This is almost certainly incomplete.
Needs careful scrutiny
2016-10-07 10:34:50 -04:00
Mohammed Sadiq
22ae9d0884 examples: use G_DECLARE_FINAL_TYPE in applications
G_DECLARE_FINAL_TYPE was introduced in glib 2.44.
We shall use that now so that lots of boilerplate code can
be reduced.

https://bugzilla.gnome.org/show_bug.cgi?id=770278
2016-09-10 09:01:08 -04:00
Matthias Clasen
22b6df025e Fix example Makefiles
Put OBJS before LIBS on the commandline to make things
work better.

https://bugzilla.gnome.org/show_bug.cgi?id=768142
2016-07-03 13:54:11 -04:00
Matthias Clasen
213f74fe82 tutorial: Drop excessive margin from headerbar
It is no longer necessary to add extra margins around the
center child in a headerbar.
2016-02-27 23:28:17 -05:00
Emmanuele Bassi
9aae351487 examples: Clean up the standalone Makefiles
Do not hardcode GCC as the compiler; use $(shell) expansion instead of
backticks; split the built source into its own variable.
2015-05-26 18:01:39 +01:00
Emmanuele Bassi
c55c18c23e examples: Fix clean rule in stand alone Makefiles
Remove all the built files, including the exampleapp binary.
2014-12-06 13:30:24 +00:00
Emmanuele Bassi
3b2cf140a2 Add standalone Makefile for the examples
We want to allow people to build the examples easily, without
necessarily requiring them to build the whole of GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=741041
2014-12-02 19:23:50 +00:00
Matthias Clasen
f85093a136 Beautify example Makefiles a bit 2014-11-29 00:26:52 -05:00
Matthias Clasen
380ca9bc56 Make include order consistent in example applications
Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=740537
2014-11-28 23:57:16 -05:00
Matthias Clasen
35f4243315 example: Make search button square
The image-button style class takes care of it.
2014-04-17 22:55:39 -04:00
Matthias Clasen
fcba75c2ba example: Modernize the prefs dialog
We should show the current best practice for this kind of
dialog, and use a headerbar with a window close button.
2014-04-17 22:55:39 -04:00
Matthias Clasen
b718b95aab example: Port to gtk_application_set_accels_for_action
Instead of hardcoding an accelerator in the ui file, use
gtk_application_set_accels_for_action.
2014-04-17 22:55:38 -04:00
Matthias Clasen
c502ff73fe example: Fix up margins
This makes the code match what we show in the screenshots. This
broke when headerbars were changed to allow titles to extend into
the margin.
2014-04-17 22:55:37 -04:00
Jasper St. Pierre
2d27e7e978 examples: Use git.mk 2013-08-07 06:18:07 -04:00
Matthias Clasen
c9c8272028 Make examples use search-changed signal
This updates the examples for the new GtkSearchEntry api.
2013-08-02 00:56:00 +02:00
Matthias Clasen
c9ce98714d example: Use declared callbacks where possible
Replace manual signal connections with signal handlers
declared in the ui file, where possible.
2013-07-27 21:00:33 -04:00
Matthias Clasen
cda60c3c40 Another round of template binding api changes
We rename the gtk_widget_class_bind_template_child{_internal}
macros by appending a _private to their name. Otherwise, it
would be too magic to pass the 'public' names as arguments,
but affect a member of the Private struct. At the same time,

Add two new macros with the old names,
gtk_widget_class_bind_template_child{_internal} that operate
on members of the instance struct.
2013-07-26 16:29:12 -04:00
Emmanuele Bassi
89ae3524a3 Rename the widget template API
The macros and functions are inconsistently named, and are not tied to
the "template" concept - to the point that it seems plausible to use
them without setting the template.

The new naming scheme is as follows:

  gtk_widget_class_bind_template_child_full
  gtk_widget_class_bind_template_callback_full

With the convenience macros:

  gtk_widget_class_bind_template_child
  gtk_widget_class_bind_template_child_internal
  gtk_widget_class_bind_template_callback

https://bugzilla.gnome.org/show_bug.cgi?id=700898
https://bugzilla.gnome.org/show_bug.cgi?id=700896
2013-07-26 13:52:15 -04:00
Alexander Larsson
a8e84545d1 widget: Use a real offset in gtk_widget_class_automate_child
Using an offset from the struct means you can have children in
both the public and private (via G_PRIVATE_OFFSET) parts of the
instance. It also matches the new private macros nicer.

https://bugzilla.gnome.org/show_bug.cgi?id=702563

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2013-07-26 08:41:09 -04:00
Matthias Clasen
7fe3455c9a Getting started: Drop ugly signal handler cleanup
I disconnected signals in dispose() to avoid a visible-tab
change notification during destruction, but this is clunky.

Instead, make the notify::visible-tab signal handler bail out
early when called during destruction.
2013-07-24 07:31:05 -04:00
Matthias Clasen
b73027aa04 Getting started: Use <choices> in the schema
The use of a manually-specified enum is a little unusual.
This is really meant to be done by <choices>.
2013-07-24 07:31:05 -04:00
Matthias Clasen
99203f09f2 Getting started: Coding style updates
Make the new examples use GTK+ coding style.
2013-07-24 07:31:05 -04:00
Matthias Clasen
8087bb7a22 Add a new example app
Add a new example to the getting started part of the docs. The focus
of this example is on 'new stuff': GtkApplication, templates, settings,
gmenu, gaction, GtkStack, GtkHeaderBar, GtkSearchBar, GtkRevealer,
GtkListBox, GtkMenuButton, etc.

It is being developed in several steps. Each step is put in a separate
directory below examples/: application1, ..., application8. This is a
little repetitive, but lets us use the code of all examples in the
documentation.
2013-07-20 23:04:47 -04:00