GNOME Bugzilla – Bug 381914
gettextproperty does not return anything
Last modified: 2006-12-04 07:10:56 UTC
Please describe the problem: the funtion gettextproperty must return the foreground / background colour of text (if any) in a range. But it doesnt. Even if text has a background colour, it returns nothing. I tested this by searching for a word in gedit (in which case the search word is highlighted in yellow if found in the text), and getting the property of that word.Also tested with syntax highlighting (in which case foreground colour changes if a keyword is typed). Still it does not return anything. Steps to reproduce: 1. open gedit, type some text and search for something in the text. close the find dialog. note the start position of the searched (and now highlighted) word in the text (count from 0) and end postion too (= start + length of word) 2. now in a terminal start python and enter "from ldtp import *" 3. then enter "gettextproperty('*gedit','txt0',start,end)" Actual results: does not retun any value Expected results: it should return : bg-color: followed by the R,G,B components of the colour used to highlight the word (yellow by default i.e 65535,65535,30840) Does this happen every time? yes Other information:
gnome version being used is : 2.16.1
It works fine for me with Gedit 2.16.1 in OpenSuSE 10.2. I followed the steps as you have mentioned. Open the file, search for some content and then close the find dialog. Result: >>> from ldtp import * >>> getcursorposition('*gedit','txt0') 160 >>> # Searched for the text 'Content' in a HTML file ... >>> gettextproperty('*gedit','txt0',160,167) 'underline:none; strikethrough:false; weight:400; bg-color:65535,65535,30840; fg-color:65535,0,65535; style:normal'