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 786144 - GtkInfoBar Example - Wrong at developer.gnome.org (looks like typo/copy/paste)
GtkInfoBar Example - Wrong at developer.gnome.org (looks like typo/copy/paste)
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Documentation
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-08-11 08:01 UTC by David C. Rankin
Modified: 2017-08-12 20:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David C. Rankin 2017-08-11 08:01:15 UTC
At:

https://developer.gnome.org/gtk3/stable/GtkInfoBar.html

In the infobar example (lines for context):

// set up info bar
GtkWidget *widget;
GtkInfoBar *bar;

widget = gtk_info_bar_new ();
bar = GTK_INFO_BAR (bar);

The assignment of:

bar = GTK_INFO_BAR (bar);      /* <--- ERROR 'bar' should be 'widget' */

is wrong and should be:

bar = GTK_INFO_BAR (widget);

To create the convenience reference cast of (GtkInfoBar *)widget;

Just needs fixing as it isn't something that takes long to figure out, but for someone working on infobar for the first time, it helps if the documentation is correct.
Comment 1 Daniel Boles 2017-08-12 20:09:15 UTC
Thanks, fixed in gtk-3-22 and master.