Window.class WINDOW_GadgetHelp and IDCMP problem

This forum is for general developer support questions.
Post Reply
blmara
Posts: 76
Joined: Thu Jun 23, 2011 9:03 am
Location: Vantaa, Finland

Window.class WINDOW_GadgetHelp and IDCMP problem

Post by blmara »

Hi,

in my program I modify some IDCMP flags in response to certain events. For example, after getting a WMHI_GADGETUP I stop receiving intuiticks with

Code: Select all

...
            IIntuition->ModifyIDCMP(dobj->win,dobj->win->IDCMPFlags & (~IDCMP_INTUITICKS));
...
I have used WINDOW_GadgetHelp to get my window object show gadget help hints and each gadget has a GA_HintInfo string. They are shown fine until WMHI_GADGETUP handling, after which no hints are shown anymore. Could this be because of removing intuiticks?

I managed to restore gadget hints by

Code: Select all

...
 IIntuition->SetAttrs(dobj->winobj,WINDOW_GadgetHelp,TRUE,TAG_DONE);
...
but this seems to have side effects with IDCMP messages. So, how could I use both approaches (gadget hints and to be able to modify IDCMP messages received by my proghram) at the same time?

Marko
Marko
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: Window.class WINDOW_GadgetHelp and IDCMP problem

Post by thomasrapp »

blmara wrote:Hi,

in my program I modify some IDCMP flags in response to certain events. For example, after getting a WMHI_GADGETUP I stop receiving intuiticks with

Code: Select all

...
            IIntuition->ModifyIDCMP(dobj->win,dobj->win->IDCMPFlags & (~IDCMP_INTUITICKS));
...
IMHO you must not call ModifyIDCMP on a window which was created by window.class. The window is property of the class and you must not change it without telling the class.

You might try to SetAttrs(dobj->winobj,GA_IDCMP,dobj->win->IDCMPFlags & (~IDCMP_INTUITICKS),TAG_DONE); but this probably won't clear INTUITICKS because the class needs IntuiTicks for the GadgetHelp timing.
I have used WINDOW_GadgetHelp to get my window object show gadget help hints and each gadget has a GA_HintInfo string. They are shown fine until WMHI_GADGETUP handling, after which no hints are shown anymore. Could this be because of removing intuiticks?
Yes, sure.
I managed to restore gadget hints by

Code: Select all

...
 IIntuition->SetAttrs(dobj->winobj,WINDOW_GadgetHelp,TRUE,TAG_DONE);
...
but this seems to have side effects with IDCMP messages.
Sure. Window.class will set all IDCMP flags it needs. As it needs IntuiTicks for GadgetHelp, IntuiTicks will be enabled if you set GadgetHelp.
So, how could I use both approaches (gadget hints and to be able to modify IDCMP messages received by my proghram) at the same time?
You can't. Set a flag in your program that you don't want IntuiTicks and when it is set, ignore the IntuiTicks you receive.
blmara
Posts: 76
Joined: Thu Jun 23, 2011 9:03 am
Location: Vantaa, Finland

Re: Window.class WINDOW_GadgetHelp and IDCMP problem

Post by blmara »

thomasrapp wrote: IMHO you must not call ModifyIDCMP on a window which was created by window.class. The window is property of the class and you must not change it without telling the class.

You might try to SetAttrs(dobj->winobj,GA_IDCMP,dobj->win->IDCMPFlags & (~IDCMP_INTUITICKS),TAG_DONE); but this probably won't clear INTUITICKS because the class needs IntuiTicks for the GadgetHelp timing.
...
So, how could I use both approaches (gadget hints and to be able to modify IDCMP messages received by my proghram) at the same time?
You can't. Set a flag in your program that you don't want IntuiTicks and when it is set, ignore the IntuiTicks you receive.
Thanks, I'll do like that. Hmm...this is something that should be entered to window.class autodoc as the 'Intuition time' examples use ModifyIDCMP also.

Marko
Marko
Post Reply