RE: [gtkmm] Can this be done with gtkmm?
- From: Murray Cumming Comneon com
- To: seguso forever tin it, gtkmm-list gnome org
- Cc: gtk-devel-list gnome org
- Subject: RE: [gtkmm] Can this be done with gtkmm?
- Date: Thu, 18 Dec 2003 13:15:50 +0100
> I am writing a Label capable of wrapping itself in order 
> not to be wider than X pixels. Can you please help me clean 
> up the code of extract_text_of_line() in order to use only 
> gtkmm (currently I am using 
> PangoLayoutLine *)?
[snip]
>                 Glib::ustring 
> extract_text_of_line(Glib::RefPtr<Pango::LayoutLine> aLayoutLine, 
>                                                    
> Glib::ustring aText){
>                         PangoLayoutLine * lPtr = aLayoutLine->gobj();
>                         const char * lText = aText.c_str();
>                         string s = "";
>                         for (int i=0; i< lPtr->length; i++){
>                                 char c = 
> lText[(lPtr->start_index) + i];
>                                 s+=c;
>                         }
>                         return s;
You are using the PangoLayoutLine::length struct field:
http://developer.gnome.org/doc/API/2.2/pango/pango-Layout-Objects.html#Pango
LayoutLine
By default, struct fields are private (you should not use them) unless the
documentation says otherwise. If the GTK+ developers say that this field
should be accessed directly, then we will wrap it in gtkmm 2.4.
Murray Cumming
www.murrayc.com
murrayc usa net 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]