|
Code: |
%module MyModule
%{ #include "MyModule.h" %} |
Code: |
#include <wxCommon.h>
void OpenDialog(void* frame); void HelloWorld(); |
Code: |
#include "MyModule.h"
#include "windows.h" void HelloWorld() {MessageBox(NULL,"Hello","World",MB_OK);} void OpenDialog (void* frame) { wxWindow *wxframe = (wxWindow *) frame; wxFileDialog *fd = new wxFileDialog(wxframe); fd->ShowModal(); } |
Code: |
package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
require("wx") frame = wx.wxFrame( wx.NULL, wx.wxID_ANY, "wxLua Frame", wx.wxDefaultPosition, wx.wxSize(450, 450), wx.wxDEFAULT_FRAME_STYLE ); package.cpath = "MyModule.dll" require("MyModule") MyModule.HelloWorld(); frame:Show(); MyModule.OpenDialog(frame); print("OK") wx.wxGetApp():MainLoop() |
Code: |
lua script.lua |