After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 381914 - gettextproperty does not return anything
gettextproperty does not return anything
Status: RESOLVED NOTABUG
Product: LDTP
Classification: Other
Component: ldtp
0.6.x
Other All
: Normal normal
: ---
Assigned To: LDTP maintainers
LDTP Development Mailing List
Depends on:
Blocks:
 
 
Reported: 2006-12-03 16:30 UTC by srinivas
Modified: 2006-12-04 07:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description srinivas 2006-12-03 16:30:38 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:
Comment 1 srinivas 2006-12-03 16:36:05 UTC
gnome version being used is : 2.16.1
Comment 2 Nagappan Alagappan 2006-12-04 07:10:56 UTC
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'