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 708194 - Wrap GtkHeaderBar
Wrap GtkHeaderBar
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2013-09-16 20:54 UTC by Juan R. Garcia Blanco
Modified: 2013-09-18 08:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Wrap GtkHeaderBar (6.03 KB, patch)
2013-09-16 20:54 UTC, Juan R. Garcia Blanco
committed Details | Review

Description Juan R. Garcia Blanco 2013-09-16 20:54:43 UTC
Created attachment 255064 [details] [review]
Wrap GtkHeaderBar

First version of a GtkHeaderBar. An example of how to use it is still under development.
Comment 1 Murray Cumming 2013-09-18 07:42:39 UTC
Review of attachment 255064 [details] [review]:

There were just some simple mistakes here, which I've noted just to help you learn. I have fixed them and pushed the patch. Many thanks.

::: gtk/src/headerbar.hg
@@ +50,3 @@
+  _WRAP_METHOD(void set_title(const Glib::ustring& title), gtk_header_bar_set_title)
+  // The returned string is owned by the widget and must not be modified of freed
+  _WRAP_METHOD(const Glib::ustring& get_title() const, gtk_header_bar_get_title)

We do not generally return const & strings. Just returning by value is simpler. Some people like to do this, but it's generally an premature optimisation that risks memory problems.

@@ +57,3 @@
+
+  _WRAP_METHOD(void set_custom_title(Gtk::Widget& title_widget), gtk_header_bar_set_custom_title)
+  _WRAP_METHOD(Gtk::Widget* get_custom_title(), gtk_header_bar_get_custom_title) // transfer none

We don't need the Gtk:: prefix while we are in the Gtk namespace.

The "transfer none" is also not interesting when dealing with Widgets rather than Objects (not using RefPtr).

@@ +67,3 @@
+
+
+  _WRAP_PROPERTY("custom-title", Gtk::Widget*)

These properties are not in any .defs file yet.