Xwt.GtkBackend.FastPangoAttrList.AddAttributes C# (CSharp) Method

AddAttributes() public method

public AddAttributes ( TextIndexer indexer, IEnumerable attrs ) : void
indexer TextIndexer
attrs IEnumerable
return void
        public void AddAttributes(TextIndexer indexer, IEnumerable<TextAttribute> attrs)
        {
            foreach (var attr in attrs)
                AddAttribute (indexer, attr);
        }

Usage Example

Esempio n. 1
0
        internal static TextIndexer ApplyFormattedText(this Gtk.Label label, FormattedText text)
        {
            TextIndexer indexer = null;
            var         list    = new FastPangoAttrList();

            if (text != null)
            {
                if (label.IsRealized)
                {
                    var color    = Gdk.Color.Zero;
                    var colorVal = label.StyleGetProperty("link-color");
                    if (colorVal is Gdk.Color)
                    {
                        color = (Gdk.Color)colorVal;
                    }
                    if (!color.Equals(Gdk.Color.Zero))
                    {
                        list.DefaultLinkColor = color;
                    }
                }
                indexer = new TextIndexer(text.Text);
                list.AddAttributes(indexer, text.Attributes);
            }
            gtk_label_set_attributes(label.Handle, list.Handle);

            return(indexer);
        }
All Usage Examples Of Xwt.GtkBackend.FastPangoAttrList::AddAttributes