After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 544858 - Seal GtkAdjustment
Seal GtkAdjustment
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.13.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 588339
 
 
Reported: 2008-07-26 16:42 UTC by Christian Dywan
Modified: 2009-07-11 23:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Seal GtkAdjustment (7.08 KB, patch)
2008-07-26 18:43 UTC, Christian Dywan
none Details | Review
Updated patch (11.39 KB, patch)
2008-08-05 12:48 UTC, Michael Natterer
none Details | Review
Yet another one (12.23 KB, patch)
2008-08-05 13:44 UTC, Michael Natterer
committed Details | Review

Description Christian Dywan 2008-07-26 16:42:05 UTC
GtkAdjustment isn't sealed.

It was requested to do this before the Gtk 2.14 API freeze.
Comment 1 Christian Dywan 2008-07-26 18:43:26 UTC
Created attachment 115331 [details] [review]
Seal GtkAdjustment

This patch seals the struct and adds accessors, nothing complicated.
Comment 2 Michael Natterer 2008-08-05 12:48:50 UTC
Created attachment 115892 [details] [review]
Updated patch

New patch fixes up API docs and enhances them and adds
gtk_adjustment_configure() to easily set multiple values
at once without having to worry about multiple emissions
of "changed".
Comment 3 Michael Natterer 2008-08-05 13:44:29 UTC
Created attachment 115900 [details] [review]
Yet another one

Makes sure "changed" is always emitted in configure() even if property
notification is frozen externally.
Comment 4 Matthias Clasen 2008-08-05 14:27:13 UTC
+ * When setting multiple adjustment properties via their individual
+ * setters, multiple "changed" signals will be emitted. However, since
+ * the emission of the "changed" signal is tied to the emission of the
+ * "GObject::notify" signals of the changed properties, it's possible
+ * to compress the "changed" signals into one by calling
+ * g_object_freeze_notify() and g_object_thaw_notify() around the
+ * calls to the individual setters.

Wouldn't it be more straightforward to recommend that people use

g_object_set (adj, "lower", lower, "upper", upper,...)

instead of messing with freeze/thaw ? Or just point them at
gtk_adjustment_configure...

Comment 5 Michael Natterer 2008-08-05 14:47:13 UTC
Fixed, including the doc additions suggested by Matthias:

2008-08-05  Michael Natterer  <mitch@imendio.com>

	Bug 544858 – Seal GtkAdjustment

	* gtk/gtk.symbols
	* gtk/gtkadjustment.[ch] (struct GtkAdjustment): seal all struct
	members.

	Add accessors for all properties and additionally a new function
	gtk_adjustment_configure() which sets all properties at
	once. Patch by Christian Dywan and myself.