I am attempting to contribute to the waxe library by adding some features that should have been added some time ago. One of these features is the ability to add a sub menu to any menu on the menu bar, which makes things a bit easier to organise.
The source code for this attempt can be found here.
However, when I try this with the following example code, I get an error when launching (despite the fact that it’s building just fine):
could not load module waxe@set_window_handle__2
And the example code:
class FileMenu extends Menu
{
private var _newSubMenu:Menu;
public function new(startIndex:Int=0)
{
super("");
_newSubMenu = new Menu("");
_newSubMenu.append(++startIndex, "Project...");
_newSubMenu.append(++startIndex, "Map...");
_newSubMenu.append(++startIndex, "Scene...");
appendSubMenu(_newSubMenu, "New");
}
}
class MainMenu extends MenuBar
{
private var _fileMenu:FileMenu;
public function new(frame:Frame)
{
super();
_fileMenu = new FileMenu();
append(_fileMenu, "File");
frame.wxSetMenuBar(this);
}
}
class Main
{
private var _mainFrame:Frame;
private var _mainMenuBar:MainMenu;
private var _lblGeneric:StaticText;
public function new()
{
_mainFrame = Frame.create(null, 0, "RPGFL Editor", {x: 0, y: 0}, {width: 800, height: 600});
App.setTopWindow(_mainFrame);
_mainFrame.shown = true;
_mainMenuBar = new MainMenu(_mainFrame);
_lblGeneric = StaticText.create(_mainFrame, 2, "Hello, there.");
}
static function main()
{
App.boot(function() { new Main(); });
}
}
I haven’t done any CFFI stuff before, so this is new to me, but from what I can tell the error is referencing an issue when grabbing the handler of the first parameter for the new function, on the line stating appendSubMenu(_newSubMenu, "New");
where the handler is assumed to be _newSubMenu
.
I don’t know if I have interfaced the code incorrectly or there is a problem with the reference itself, the error message is a bit bland.
I build using the following command, if it helps:
haxe -cp src/ -lib waxe -main Main -cpp bin/windows -D HXCPP_M64