How to redraw gadget from an input handler ?

5 posts / 0 new
Last post
TSK
TSK's picture
Offline
Last seen: 1 year 1 month ago
Joined: 2011-06-28 02:06
How to redraw gadget from an input handler ?

How can I redraw my gadget from an input handler ? Calling DoRender() crashes.

tboeckel
tboeckel's picture
Offline
Last seen: 4 years 5 months ago
Joined: 2011-09-13 12:32
Re: How to redraw gadget from an input handler ?

Send a signal or message to your own task to do the actual DoRender() call.

TSK
TSK's picture
Offline
Last seen: 1 year 1 month ago
Joined: 2011-06-28 02:06
Re: How to redraw gadget from an input handler ?

I can't imagine where I could put a Wait() loop inside a gadget class !? Doing anything inside the dispatcher function blocks the whole Intuition and all the rest.

I'm wondering how the listbrowser gadget handles internally resizing of columns with a mouse ?

thomas
thomas's picture
Offline
Last seen: 3 months 1 week ago
Joined: 2011-05-16 14:23
Re: How to redraw gadget from an input handler ?

Please define "input handler".

My definition of an input handler is a routine which gets called by input.device after adding it with an IND_ADDHANDLER command.

From your last reply I suppose you rather mean the GM_HANDLEINPUT method, right? This is not an input handler, it is a method of your gadget class.

I am not familiar with DoRender, but after reading the autodocs I would say it is exactly what you should use.

On OS3 I would use this which I assume is the contents of DoRender:

  1. if (msg->gpi_GInfo)
  2. {
  3. struct RastPort *rp;
  4. if (rp = ObtainGIRPort (msg->gpi_GInfo))
  5. {
  6. DoMethod (o,GM_RENDER,msg->gpi_GInfo,rp,GREDRAW_REDRAW);
  7. ReleaseGIRPort (rp);
  8. }
  9. }
TSK
TSK's picture
Offline
Last seen: 1 year 1 month ago
Joined: 2011-06-28 02:06
Re: How to redraw gadget from an input handler ?

My bad. I forgot input events are in a list. I was checking only the first event. So I was wondering I'll get only the first RAWMOUSE event but not anything else. Also the return values have to be correct to keep the gadget active when needed. With input handler I meant adding a handler to the input.device. But I don't need it anymore.

Thanks everybody.

Log in or register to post comments