WindowRef from jitter ctxt & patcher in Max6

Nov 8, 2011 at 12:41pm

WindowRef from jitter ctxt & patcher in Max6

I am trying to make my ol.mousewheel object work in Max6

previously I used this code to either get the frontmost Window handle or the window handle of a jitter context. Neither is working now. I am hoping I can still use my carbon event handler code to grab the mousewheel events, but I do not know get the windowref in the first place in Max6. I think it would be better to get the window of the patcher where the object is, rather than using FrontWindow();

any ideas?

thanks,

oli

void olmousewheel_start(t_olmousewheel *x)
{
void *window;

olmousewheel_stop(x);

window = jit_object_findregistered(x->ctxt);
if(window) jit_object_method(window, gensym(“get_window_ptr”), &x->winRef);
else x->winRef = FrontWindow(); //if no argument, get the patcher window

x->eventHandlerRef = 0;

const EventTypeSpec eventTypes[] =
{
{ kEventClassMouse, kEventMouseWheelMoved },
};

static EventHandlerUPP handleWindowEventUPP = 0;

if (handleWindowEventUPP == 0) handleWindowEventUPP = NewEventHandlerUPP (handleWindowEvent);

InstallWindowEventHandler (x->winRef, handleWindowEventUPP,
GetEventTypeCount (eventTypes), eventTypes,
(t_olmousewheel *) x, &x->eventHandlerRef);
}

#59894
Feb 13, 2012 at 5:21pm

Hi oli,
do you released now a Max6 version of your very usefull ol.mousewheel object ?

#215633
Feb 13, 2012 at 5:51pm

No… Jit.window reports mouse wheel messages in max6 which meant I didnt need an extra object

#215634
Feb 13, 2012 at 6:12pm

Ok, i didn’t know that,
do you know how to report mouse wheel messages in a simple patcher Window context ?
Thanks.

#215635
Feb 14, 2012 at 11:09pm

No sorry, didn’t work it out yet

#215636

You must be logged in to reply to this topic.