Hello,
I’m trying to use StyledTextCtrl_MarkerDefineRGBAImage function,
but I can’t find out how the image must be passed.
From scintilla documention I get that it is supposed to be
SCI_MARKERDEFINERGBAIMAGE(int markerNumber, const char *pixels)
so I thought it should work by providing a string
img = ‘\x00\x00\x00\x00’
editor.RGBAImageSetWidth(14)
editor.MarkerDefineRGBAImage(0,img)
``
then I tried passing a list
img = [0,0,0,0]
editor.MarkerDefineRGBAImage(0,img)
``
and finally I tried using ctypes with byte and ubyte
import ctypes
img = ctypes.c_ubyte*4
img.from_buffer_copy(’\x00\x00\x00\x00’)
<c_ubyte_Array_4 object at 0x7f9902a5c9e0>
for i in img():
print i
``
0
0
0
0
editor.MarkerDefineRGBAImage(0,img())
editor.MarkerDefineRGBAImage(0,ctypes.byref(img()))
editor.MarkerDefineRGBAImage(0,ctypes.pointer(img()))
``
but all returned the same error
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/stc.py”, line 6371, in MarkerDefineRGBAImage
return _stc.StyledTextCtrl_MarkerDefineRGBAImage(*args, **kwargs)TypeError: in method ‘StyledTextCtrl_MarkerDefineRGBAImage’, expected argument 3 of type 'unsigned char const *'
So, how do I provide a ‘unsigned char const *’?
Thank you
Claudia