Where have all the flowers gone, eh IDCMP messages

8 posts / 0 new
Last post
OldFart
OldFart's picture
Offline
Last seen: 7 hours 7 min ago
Joined: 2010-11-30 14:09
Where have all the flowers gone, eh IDCMP messages

Hi,

Of late I have this odd behaviour of GUI's:
- Clicking a gadget will result in an 'empty' message stream. Any gadget, any window, any project. Any of MY current projects. Former projects c.q. older versions just work fine, so *I* do something wrong.
- Clicking 'Close window'-button will close the window just fine and terminate the program gracefully.
- Dropping an icon on a filerequester gadget works as expected (clicking the gadget's button will NOT bring up the requester proper).

Hence the question is 'quite simple': where do all those IDCMP messages go (, provided they are generated)?

Most importantly: "it used to work"...

Any ideas where to look and/or what may cause this behaviour?

Regards,
OldFart

P.s.: 'HintInfo' for these gadgets does not work either, although they are provided.

jabirulo
jabirulo's picture
Offline
Last seen: 1 week 4 days ago
Joined: 2013-05-30 00:53
Re: Where have all the flowers gone, eh IDCMP messages

Hi, did you add new gadgets/objects?
Full build of the projects, as sometimes just compiling only changed sources not enough.

For gadgets (unde ReAction), to be "event active", you need these tags:
GA_ID, OID_ASGNLIST,
GA_RelVerify, TRUE,

and on your event function:

  1. ...
  2. #define OBJ(x) gui->Objects[x]
  3. #define GAD(x) (struct Gadget *)gui->Objects[x]
  4. ...
  5. BOOL Process_GUI(struct CMDGUI *gui)
  6. {
  7. BOOL done = TRUE;
  8. uint16 code = 0;
  9. uint32 result = WMHI_LASTMSG, siggot = 0, wsigmask = 0,
  10. res_value = 0;
  11.  
  12. IIntuition->GetAttr(WINDOW_SigMask, OBJ(OID_MAIN), &wsigmask);
  13. siggot = IExec->Wait(wsigmask | SIGBREAKF_CTRL_C);
  14.  
  15. if(siggot & SIGBREAKF_CTRL_C)
  16. {
  17. return FALSE;
  18. }
  19.  
  20. if(siggot & wsigmask)
  21. {
  22. while( (result=IIntuition->IDoMethod(OBJ(OID_MAIN), WM_HANDLEINPUT, &code)) != WMHI_LASTMSG )
  23. {
  24. //DBUG("result=0x%lx\n",result);
  25. switch(result & WMHI_CLASSMASK)
  26. {
  27. case WMHI_CLOSEWINDOW:
  28. ...
  29. case WMHI_GADGETUP:
  30. DBUG("[WMHI_GADGETUP] code = %ld (0x%08lx)\n",code,code);
  31. switch(result & WMHI_GADGETMASK)
  32. {
  33. ...

For hintInfo, AFAIK just "WINDOW_GadgetHelp,TRUE" and on gadgets you want just add "GA_HintInfo,"bla bla bla","

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/SSD240GB/DVDRW :-P

OldFart
OldFart's picture
Offline
Last seen: 7 hours 7 min ago
Joined: 2010-11-30 14:09
Re: Where have all the flowers gone, eh IDCMP messages

Things are 'back to normal' since today as I discovered, that the issue was caused by modifying the IDCMP-flags.

Reversed that modification, which I thought were THE solution to 'a rattling IDCMP-port', which it indeed proved to be, but with side effects.
I now have a filter installed, a 'silencer' or 'muffler' if you want, that lets only pass THOSE WMHI actions which I deem relevant to the program.

The IDCMP-port is still rattling as per usual, but it now is no longer a menace.

OldFart

OldFart
OldFart's picture
Offline
Last seen: 7 hours 7 min ago
Joined: 2010-11-30 14:09
Re: Where have all the flowers gone, eh IDCMP messages

@jabirulo

Thanks, but I do know to some extent how to create a (ReAction-)GUI and handle the messages it generates. Those messages contain quite some 'unsollicited' ones, like IntuiTicks and Activation/Dectivation, the former one innundating your program with messages that all need to be handled.

In this part of your program:

  1. switch(result & WMHI_CLASSMASK)
  2. {
  3. case WMHI_CLOSEWINDOW:
  4. ...
  5. case WMHI_GADGETUP:
  6. DBUG("[WMHI_GADGETUP] code = %ld (0x%08lx)\n",code,code);
  7. switch(result & WMHI_GADGETMASK)
  8. {
  9. ...

add the following case:

  1. case WMHI_INTUITICK:
  2. {
  3. IDOS->Printf("Bang\n");
  4. break;
  5. }

and you have your machine gun arattling!

Alternatively add a 'default' case and print out all those unsollicited messages...

OldFart

jabirulo
jabirulo's picture
Offline
Last seen: 1 week 4 days ago
Joined: 2013-05-30 00:53
Re: Where have all the flowers gone, eh IDCMP messages

Oh, thx dind't know it.
And how can I "silence" unwanted WMHI_ messages?

EDIT: maybe by using ModifyIDCMP()?

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/SSD240GB/DVDRW :-P

OldFart
OldFart's picture
Offline
Last seen: 7 hours 7 min ago
Joined: 2010-11-30 14:09
Re: Where have all the flowers gone, eh IDCMP messages

@jabirulo

Your suggestion about using 'ModifyIDCMP()' will probably result in messages not reaching your usual (window's) messageport. This requires then installation of an IDCMPHook and ancillary IDCMPHookBits in order to intercept and handle them off. This was the very reason for me of starting this thread.
Admittedly I have not yet covered that ground, but I am investigating it and come to think about it, I may give it priority, as this affects virtually all my software in one sweep.

The silencing method I applied is more of a stop-gap kludge.

OldFart

jabirulo
jabirulo's picture
Offline
Last seen: 1 week 4 days ago
Joined: 2013-05-30 00:53
Re: Where have all the flowers gone, eh IDCMP messages

ok, will do some test here with ModifyIDCMP() and see what happens on my little GUIs

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/SSD240GB/DVDRW :-P

OldFart
OldFart's picture
Offline
Last seen: 7 hours 7 min ago
Joined: 2010-11-30 14:09
Re: Where have all the flowers gone, eh IDCMP messages

@jabirulo

ok, will do some test here with ModifyIDCMP() and see what happens on my little GUIs

Please tell about your experience later on, when you've gained some insight in the matter.

OldFart

Log in or register to post comments