Open greatwolf opened 2 weeks ago
I suspect you may be right, as it looks like a direct translation of the API without a good way to provide that parameter. In fact, other interface files have comments to the effect that wxlua doesn't handle const char* const*
parameters.
Would using MarkerDefineRGBAImage
or MarkerDefineBitmap
work (the latter is not available with wxwidgets 3.1.3+)?
I think it will be better to change MarkerDefinePixmap(int markerNumber, const char* const* xpmData);
to MarkerDefinePixmap(int markerNumber, const char* xpmData);
to allow passing a string with xpmData content.
I'll have to take a look at MarkerDefineRGBAImage
and MarkerDefineBitmap
-- those could probably work. I was looking at MarkerDefinePixmap
because scintilla provides some icons https://www.scintilla.org/Icons.html and they're in xpm format.
That said, the current MarkerDefinePixmap
does seem like a design defect if there isn't a convenient way to use it from lua side. Changing it to accept either a lua string or lua table seems to make sense to me.
I'm not sure whether to ask this on here or on wxLua. I'm trying to change the way the breakpoint icon looks on the left margin gutter of the editor and it looks like
SCI_MARKERDEFINEPIXMAP
is what I'm after.The corresponding wxlua binding is here https://github.com/pkulchenko/wxlua/blob/4d83c8d44eeccf88683ca0146a13b16d0b0d4264/wxLua/bindings/wxwidgets/wxstc_override.hpp#L86.
What's unclear to me is how to actually pass in that xpm data as
const char **
from the lua side. Been banging my head against the wall trying to figure this out. I looked at https://github.com/pkulchenko/wxlua/blob/master/wxLua/docs/binding.md and https://github.com/pkulchenko/wxlua/blob/master/wxLua/docs/wxlua.md. Closest thing I could find is this section:I also looked at some of the wxlua samples like https://github.com/pkulchenko/wxlua/blob/4d83c8d44eeccf88683ca0146a13b16d0b0d4264/wxLua/samples/calculator.wx.lua#L242 and https://github.com/pkulchenko/wxlua/blob/4d83c8d44eeccf88683ca0146a13b16d0b0d4264/wxLua/samples/catch.lua#L601 hoping for some usage hints.
Those examples turn xpm, represented as a table from the lua side, into a
wxBitmap
and thenwxIcon
. But usingwxBitmap
andwxIcon
is not a suitableuserdata
becauseMarkerDefinePixmap
wants to turn it into aconst char* const*
. I've tried passing it in as a plain lua string, as a lua table,wxBitmap
,wxIcon
. None of it seems to work.It feels like I'm missing something simple but what actually is the suitable userdata I should be using here?