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 618160 - Documentation for gtk_combo_box_get_active_iter is unclear
Documentation for gtk_combo_box_get_active_iter is unclear
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkComboBox
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-05-09 10:36 UTC by 6gNce81G4JpZHLMd41KA8n0LyTpY1FGy
Modified: 2017-08-24 20:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Elaborate on gtk_combo_box_get_activer_iter (596 bytes, patch)
2010-05-10 10:17 UTC, Christian Dywan
needs-work Details | Review

Description 6gNce81G4JpZHLMd41KA8n0LyTpY1FGy 2010-05-09 10:36:29 UTC
Suggested revision:
At line 4939 of gtkcombobox.c
/**
 * gtk_combo_box_get_active_iter:
 * @combo_box: A #GtkComboBox
 * @iter: A #GtkTreeIter
 * 
 * Sets @iter to point to the current active item, if it exists.
 * 
 * Return value: If an active item exists return %TRUE with @iter set to point to it.  Else return %FALSE and leave @iter unchanged.
 *
 * Since: 2.4
 */
Comment 1 Christian Dywan 2010-05-10 10:17:22 UTC
Created attachment 160705 [details] [review]
Elaborate on gtk_combo_box_get_activer_iter
Comment 2 Daniel Boles 2017-08-24 11:44:50 UTC
Review of attachment 160705 [details] [review]:

s/activer/active/ in the commit msg

::: gtk/gtkcombobox.c
@@ +4976,2 @@
  * @combo_box: A #GtkComboBox
  * @iter: The uninitialized #GtkTreeIter

I would change this to something like "Address of a #GtkTreeIter"; being uninitialised is not required, and there might be some arguable use-case for having an initialised, valid iter and keeping its original value if returning FALSE.

@@ +4977,3 @@
  * @iter: The uninitialized #GtkTreeIter
  * 
+ * Sets @iter to point to the currently active item, if it exists. Otherwise

I would say "if any item is active", just to avoid any risk of people thinking "if it exists" means that @iter is nullable, which it is not.
Comment 3 Daniel Boles 2017-08-24 20:43:15 UTC
Comment on attachment 160705 [details] [review]
Elaborate on gtk_combo_box_get_activer_iter

Thanks for the patch, which I adapted and pushed: