Replies: 9 comments 46 replies
|
I have not heard of this tool before, I don’t see this tool in wxWidgets (C++) If you need to watch for messages and events, maybe you can use registerWatchWinMsg import traceback
from pyrx_imp import Rx, Ge, Gs, Gi, Db, Ap, Ed
#WatchWinMsg
print("command = startWatch")
print("command = endWatch")
WM_MOUSEMOVE = 512
#messageId, hwnd, lParam, wParam, pt.x, pt.y,time;
def winMessage(msg):
if msg[0] == WM_MOUSEMOVE:
print(msg[4],msg[5])
def PyRxCmd_startWatch():
try:
Ap.Application.registerWatchWinMsg(winMessage)
except Exception as err:
print(err)
def PyRxCmd_endWatch():
try:
Ap.Application.removeWatchWinMsg(winMessage)
except Exception as err:
print(err) |
|
A bit off topic, but maybe it's not worth starting a new discussion. |
|
Yeah, I had issues with this, wxPython seems to have some additional wrappers, wxApp, wxPyApp Generally, this is not needed, using None for parent arguments works fine because wxTheApp is defined in C++ |
|
Its weird, I would expect it to hit WxRxApp’s destructor Lines 77 to 90 in 14a8e78 |
|
This line causes GstarCAD to crash on exit |
|
As I mentioned here it appears to call wxApp::SetInstance and replaces my instance, when it’s garbage collected, it’s set to null, we can’t allow this, it's UB wxPyApp derives from wxApp. Unfortunately, I cannot subclass it as it’s not in in a header. Next question is, why doesn’t wx.CallAfter work with WxRxApp, I don’t see anything special in wxPyApp |
|
You can also watch for events. My current goal is to have the host frame send events to |
|
I played around with this. This sample is interesting because it forwards messages from PreTranslateMessage to evtLoop->PreProcessMessage(msg). I tried with AcedFilterWinMsgFn, but I could tell it bogged down performance. There’s no reason to pound on wxWidgets for messages it’s never going to handle, so I removed it. I still think the best approach for the inspector, if it needs MFC messages, is for it to use Ap.Application.registerWatchWinMsg and forward the events to the inspector. I don't know how HWNDs are mapped to wxWidget IDs though Another item that may throw things off is, I use CAcModuleResourceOverride everywhere (basically a resource switcher) side note, watchWinMsg is handy when doing stuff like trying to detect a right click, or scroll action while using AcedJig |




Uh oh!
There was an error while loading. Please reload this page.
@CEXT-Dan
For my needs I quickly created something like this.
You open some frame, press
Ctrl+Alt+Iand an inspection frame opens. Do you think it can be done better? Maybe addPYRX_WX_DEBUGin the configuration?The best option would be to use
wx.lib.mixins.inspection.InspectableAppto initialize the object returned by.wxApp()All reactions