2009/12/4 Murray Cumming <[email protected]>:
> On Fri, 2009-12-04 at 10:37 +0100, Krzesimir Nowak wrote:
>> 2009/12/4 Murray Cumming <[email protected]>:
>> > On Thu, 2009-12-03 at 18:10 +0100, Krzesimir Nowak wrote:
>> >> Hi,
>> >>
>> >> In vte, first style property was added recently. I checked Gtk::Widget
>> >> code to check how such properties are wrapped and found nothing. Are
>> >> they wrapped somehow?
>> >
>> > No, I don't think so. How would an application use them?
>> >
>>
>> Since vte is terminal emulator it is sometimes useful to set geometry hints 
>> to
>> set its resizing habit like in gnome terminal [1]. For that
>> vte_terminal_get_padding()
>> was used in 0.22 or lower version. But since 0.23.1 it is deprecated and use 
>> of
>> "inner-border" style property is recommended [2].
>>
>> Krzesimir
>>
>> [1] 
>> http://git.gnome.org/cgit/gnome-terminal/tree/src/terminal-window.c?h=gnome-2-28
>> from line 2903 to 2928.
>> [2] 
>> http://git.gnome.org/cgit/vte/commit/?id=a34ea6198748e1621b8f148d81b424ca5312f818
>
> Could you please try using the C API for that for now, and then file a
> bug suggesting that we make it easier, pointing us to your example code.
>

>From what I see, there are no functions in C API for getting explicit
style properties, like, for example,
gtk_widget_style_get_link_color(), only generic getters are provided
[gtk_widget_style_get() family]. C++ API is consistent with C API and
also provides generic getters for style properties
[Gtk::Widget::get_style_property(_value)].

For now I'll use C API, because C++ API does not work for me - maybe I
was using it incorrectly.

This is what I use now:

GtkBorder* inner_border = NULL;
gtk_widget_style_get(GTK_WIDGET(m_terminal.gobj()), "inner-border",
&inner_border, NULL);
// use my inner_border and then
gtk_border_free(inner_border);

I tried to use this:

Gtk::Border* inner_border = NULL;
m_terminal.get_style_property("inner-border", inner_border);

and got a warning:

Gtk-WARNING **: can't retrieve style property `inner-border' of type
`GtkBorder' as value of type `glibmm__CustomPointer_P10_GtkBorder'

Then I tried this:

Gtk::Border inner_border; // now it is not a pointer.
m_terminal.get_style_property("inner-border", inner_border);

and got a warning:

Gtk-WARNING **: can't retrieve style property `inner-border' of type
`GtkBorder' as value of type `glibmm__CustomBoxed_10_GtkBorder'

I was shooting in the dark by trying to pass a pointer or a value.
Seems to me it is a Glib::Value issue. And Gtk::Border is just a
typedef of a GtkBorder, which is a boxed type.
_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to