mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 05:31:07 +00:00
gtk-demo: Tweak descriptions of constraints demos
Make these a little longer, and include more details.
This commit is contained in:
parent
2dbaca2464
commit
19052d4360
@ -2,8 +2,15 @@
|
||||
* #Keywords: GtkLayoutManager
|
||||
*
|
||||
* GtkConstraintLayout provides a layout manager that uses relations
|
||||
* between widgets (also known as "constraints") to compute the position
|
||||
* between widgets (also known as “constraints”) to compute the position
|
||||
* and size of each child.
|
||||
*
|
||||
* In addition to child widgets, the constraints can involve spacer
|
||||
* objects (also known as “guides”). This example has a guide between
|
||||
* the two buttons in the top row.
|
||||
*
|
||||
* Try resizing the window to see how the constraints react to update
|
||||
* the layout.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Constraints/Interactive
|
||||
* #Keywords: GtkConstraintLayout
|
||||
*
|
||||
* Demonstrate how constraints can be updates during user interaction.
|
||||
* This example shows how constraints can be updated during user interaction.
|
||||
* The vertical edge between the buttons can be dragged with the mouse.
|
||||
*/
|
||||
|
||||
|
@ -2,6 +2,10 @@
|
||||
*
|
||||
* GtkConstraintLayout allows defining constraints using a
|
||||
* compact syntax called Visual Format Language, or VFL.
|
||||
*
|
||||
* A typical example of a VFL specification looks like this:
|
||||
*
|
||||
* H:|-[button1(==button2)]-12-[button2]-|
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* Constraints/Builder
|
||||
*
|
||||
* GtkConstraintLayouts can be created in .ui files, and
|
||||
* constraints can be set up at that time as well, as this
|
||||
* example demonstrates.
|
||||
* GtkConstraintLayouts can be created in .ui files, and constraints can be
|
||||
* set up at that time as well, as this example demonstrates. It uses the
|
||||
* same setup as the “Simple” constraints demo.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
@ -22,9 +22,24 @@ constraints_grid_init (ConstraintsGrid *grid)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
constraints_grid_dispose (GObject *object)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (object);
|
||||
GtkWidget *child;
|
||||
|
||||
while ((child = gtk_widget_get_first_child (widget)))
|
||||
gtk_widget_unparent (child);
|
||||
|
||||
G_OBJECT_CLASS (constraints_grid_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
constraints_grid_class_init (ConstraintsGridClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = constraints_grid_dispose;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
|
Loading…
Reference in New Issue
Block a user