I'm wondering how to use this editor.markerDefinePixmap, specifically the XPM images.
Following does not work, I don't get the blarg icon to sidebar, instead I get white circle:
#Seewikipediahttp://en.wikipedia.org/wiki/X_PixMap#Comparison_with_other_formatsblarg=["16 7 2 1","* c #000000",". c #ffffff","**..*...........","*.*.*...........","**..*..**.**..**","*.*.*.*.*.*..*.*","**..*..**.*...**","...............*",".............**."]USER_MARKER=2addSymbol=USER_MARKER+1delSymbol=USER_MARKER+2deftestmarkers():#Allsymbolson1margineditor.setMarginMaskN(1,-1)#Createpixmaptypemarker#TODO:HowdoIdothis?"\0".joindoesn'tseemtowork!editor.markerDefinePixmap(addSymbol,"\0".join(blarg))editor.markerDeleteAll(-1)editor.markerAdd(5,addSymbol)console.write("Added symbol!\n")testmarkers()
If I change USER_MARKER value it seems to always give me white circle too, quiet odd.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ed.markerDefinePixmap(24, '''/* XPM */
static char * test_xpm = {
"32 16 2 1",
" c None",
". c #F08000", // color used for dithering
". . . . . . . . . . . . . . . . ",
" ",
If you take a look at this script from the Script Showcase, you'll how Scintilla expects it. It expects it as a C struct, so like this:
Hi!
I'm wondering how to use this editor.markerDefinePixmap, specifically the XPM images.
Following does not work, I don't get the blarg icon to sidebar, instead I get white circle:
If I change USER_MARKER value it seems to always give me white circle too, quiet odd.
ed.markerDefinePixmap(24, '''/* XPM */
static char * test_xpm = {
"32 16 2 1",
" c None",
". c #F08000", // color used for dithering
". . . . . . . . . . . . . . . . ",
" ",
If you take a look at this script from the Script Showcase, you'll how Scintilla expects it. It expects it as a C struct, so like this:
I've just tried it, and it shows up ok. You might need to extend the width of the margin though.
Cheers,
Dave.