1 // Gtk.EntryCompletion.cs - Gtk EntryCompletion customizations 2 // 3 // Authors: Todd Berman <tberman@off.net> 4 // Mike Kestner <mkestner@novell.com> 5 // 6 // Copyright (c) 2004 Todd Berman 7 // Copyright (c) 2005 Novell, Inc. 8 // 9 // This program is free software; you can redistribute it and/or 10 // modify it under the terms of version 2 of the Lesser GNU General 11 // Public License as published by the Free Software Foundation. 12 // 13 // This program is distributed in the hope that it will be useful, 14 // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 // Lesser General Public License for more details. 17 // 18 // You should have received a copy of the GNU Lesser General Public 19 // License along with this program; if not, write to the 20 // Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 // Boston, MA 02111-1307, USA. 22 23 namespace Gtk { 24 25 using System; 26 27 public partial class EntryCompletion { 28 SetAttributes(CellRenderer cell, params object[] attrs)29 public void SetAttributes (CellRenderer cell, params object[] attrs) 30 { 31 if (attrs.Length % 2 != 0) 32 throw new ArgumentException ("attrs should contain pairs of attribute/col"); 33 34 ClearAttributes (cell); 35 for (int i = 0; i < attrs.Length - 1; i += 2) { 36 AddAttribute (cell, (string) attrs [i], (int) attrs [i + 1]); 37 } 38 } 39 } 40 } 41