From: The D. <the...@bl...> - 2005-07-18 10:39:43
|
John, please can you confirm if this would work? local popMenu = wx.wxMenu() -- add normal menu items -- to position the menu for a button use local rect = mybutton.GetRect() to find the bottom left. mywindow.PopupMenuXY(popMenu, mouseEvt.GetX(), mouseEvt.GetY()) It's an example you sent when I needed to make a popup menu. I got that menu to work with explicit co-ordinates, as I never did get mouseEvt to work, it's a nil value that can't be indexed, according to the error message I got. I was hoping to use that as a basis as a translation of the stuff in the wxWidgets manual, which also doesn't work as advertised, when applied to wxLua. I'd hoped to do if (mouseEvt.ControlDown()) then dostuff end which seems logical as ControlDown is listed with GetX, and also appears inside the wxLua exe, but it fails, giving the same error as your GetX does. I tried loads of other things too: event:ControlDown(), event:mouseEvt.ControlDown(), spelling mouseEvent instead of mouseEvt..... all gave some kind of error, and I need a tested example of what works, as a basis for translating other things later. I really need help here, there is no documentation, and nothing at all on Google. This is like shooting at a tiny hole in a distant wall, while wearing a blindfold, and it's probably easier to pick locks... |