[pygtk] treeview markup entries and interactive search

Tim Evans t.evans at aranz.com
Wed Aug 20 06:22:48 WST 2008


Tasos Latsas wrote:
> Thank you for your answer, yes this is the easiest solution I could
> think too, but I was just wondering if there is a more "elegant"
> solution, like an option/flag or something ;-)
> 
> 
> Jeremy S wrote:
>> This doesn't directly answer your question, but you could always make
>> a hidden column without markup and search that column.
>>
>> On Tue, Aug 19, 2008 at 5:07 AM, Tasos Latsas <tlatsas2000 at gmail.com> wrote:
>>> hi all,
>>> I am using a treeview with some text entries and some markup text
>>> entries.eg: i have the entry "home" and the bold entry "<b>work</b>".
>>> When i start the interactive search and I hit 'h', "home" is selected as
>>> should be, but when I hit 'w', "work" is not selected unless i hit '<b' etc
>>> Is there a way to tell the interactive search to ignore the markup tags?
>>> Is this the intended behavior?
>>>
>>> Thanx for your time,
>>>  Tasos

gtk.CellRendererText has separate properties for changing font 
attributes.  In the case you describe you would set the "weight" 
property to pango.WEIGHT_BOLD and just use "text" rather than "markup".

Unless you need to change the font attributes mid-way through the text 
using the specific attributes will be a little faster than markup and 
won't interfere with searching.

-- 
Tim Evans
Applied Research Associates NZ
http://www.aranz.com/


More information about the pygtk mailing list