addMessageHook(untyped Events.MENUEVENT);
mhook.setNekoCallback(menuClickHook);
thook = window.addMessageHook(untyped Events.TRAYEVENT);
thook.setNekoCallback(TrayClickHook);
tray = new Tray(window,???swhx_16x16.ico???,???Hello Tray!???);
}
(continued)
Part III: Extending the Possibilities
528
static function mouseRButtonHook ()
{
trace( ???Option ??? + m.showPopup( window.handle ) + ??? was selected!??? );
return 0;
}
static function menuClickHook()
{
trace( ???Option p1: ??? + mhook.p1 );
trace( ???Option p2: ??? + mhook.p2 );
trace( ???Callback: ??? + hook.callbackData );
return 0;
}
static function TrayClickHook()
{
if ( Std.string(thook.p2) == Std.string(Events.RBUTTONUP) )
trace( ???Option ??? + m.showPopup( window.handle ) + ??? was selected!??? );
return 0;
}
static function cleanUp()
{
window.removeMessageHook(hook);
window.removeMessageHook(mhook);
window.removeMessageHook(thook);
return true;
}
}
If you compile and run this code, you should find a nice menu at the top of the window, as well as right -
click context menus assigned to the window and to the tray icon in the system tray.
Pages:
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981