Re: [gtkmm] PangoStyle problem



Mark,

I don't know if this would help you, but in my app, granule, I have 
a text and a marker:

/* DeckPlayer.h */

	Gtk::TextView m_example;

	Glib::RefPtr<Gtk::TextBuffer::TagTable> m_tag_table;
	Glib::RefPtr<Gtk::TextBuffer::Tag> m_marker;

and then initialize it to a different color (in your case it
would be italic or whaterver - just change the property):

/* DeckPlayer.cpp */

	m_tag_table = m_example.get_buffer ()->get_tag_table ();
	m_marker->property_foreground () = "red";
	m_tag_table->add (m_marker);

Then when the time comes to change the text, I apply my
marker to the region of the text:

Glib::RefPtr<Gtk::TextBuffer> text_ref = m_example.get_buffer ();
...
Gtk::TextBuffer::iterator iter = text_ref->begin ();
...
text_ref->apply_tag (m_marker, iter, iter_next);

Sometimes, to see the changes immediately, I have to drain the
event queue.

hope this helps,
-Vlad

P.S. Another thing to look at might be the set_markup() method (if it
is applicable).

On Sat, 2004-07-17 at 08:15, _janus_ katamail com wrote:
> Hi everybody,
> 
> here is my problem:
> i'm using gtkmm-2.0 and i have a
> 
> Gnome::Canvas::Text *name;
> 
> inside OGClasse class. I'd like to change it's style, for doing that i have this function:
> 
> void OGClasse::setItalic(bool res)
> {
> 	PangoStyle s;
> 	if(res) s = PANGO_STYLE_ITALIC;
> 	else s = PANGO_STYLE_NORMAL;
> 	name->property_style_set() = true;
> 	name->property_style() = s;
> }
> 
> The compiler gives no errors, but during runtime i receive this message
> 
> (guml:2779): GLib-GObject-WARNING **: unable to set property `style' of type 
> `PangoStyle' from value of type `glibmm__CustomBoxed_10PangoStyle'.
> 
> 
> I don't understand what's the problem. Perhaps am i missing some include file?
> I tried to include <pango/pango-font.h> but nothing changed.
> 
> Thx 4 your answers,
> Mark
> 
> ________________________________________________________________________
> Cerchi un laboratorio fotografico aperto 24 ore su 24?
> Stampa le tue foto digitali su Kataweb e le ricevi a domicilio in 48 ore.
> http://www.kataweb.it/foto
> 
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
-- 
_____________________________________________________________
Vladislav Grinchenko       http://home.comcast.net/~3rdshift/
                                 e-mail: 3rdshift comcast net
                                                   
      Focus on quality, and productivity will follow.
_____________________________________________________________




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]