Re: Make `Widget.get_style_context() const` return a `StyleContext const`?

2019-12-12 Thread Kjell Ahlstedt via gtkmm-list
It looks like a mistake. I've changed it in the master branch (gtkmm4). 
I guess we have to live with it in gtkmm3. The same change there would 
break API. Perhaps also ABI, but I'm not sure.


Kjell

On 2019-12-10 16:05, Daniel Boles via gtkmm-list wrote:
I suspect this might have been asked and discredited already, so if it 
has, apologies and link me :)


In gtk/src/widget.hg we have:

```
  _WRAP_METHOD(Glib::RefPtr get_style_context(), 
gtk_widget_get_style_context, refreturn)
  _WRAP_METHOD(Glib::RefPtr get_style_context() 
const, gtk_widget_get_style_context, refreturn, constversion)

```



___
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list


Make `Widget.get_style_context() const` return a `StyleContext const`?

2019-12-10 Thread Daniel Boles via gtkmm-list
I suspect this might have been asked and discredited already, so if it has,
apologies and link me :)

In gtk/src/widget.hg we have:

```
  _WRAP_METHOD(Glib::RefPtr get_style_context(),
gtk_widget_get_style_context, refreturn)
  _WRAP_METHOD(Glib::RefPtr get_style_context() const,
gtk_widget_get_style_context, refreturn, constversion)
```

Should the const version return a RefPtr to a `const StyleContext`? I feel
like perhaps it should.

If we have the style context, we can change how the widget is drawn, which
is arguably quite a non-const thing to do with something whose main purpose
is to be displayed :-)
___
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list