View Single Post
Old 01 August 2021, 18:44   #19
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Yes that worked. I was under the impression that selected would need to be retrieved using GT_GetGadgetAttrs. I see this is a flag however not an attribute.

Quote:
Originally Posted by bebbo View Post
hm:
gad->Flags & GFLG_SELECTED
does not work for you?
This is my code;
Code:
/* Main Loop. */    
while(run)    {        

      /* Wait for an event to happen. */        
      int w = Wait(search_onKeyPressSignal | 1L << window->UserPort->mp_SigBit);

      ...

      /* Get message data. */        
      msg = (struct IntuiMessage *)GT_GetIMsg(window->UserPort);

      if(msg->Class == IDCMP_CLOSEWINDOW){ ... }
      ...

      /* Close message. */        
      GT_ReplyIMsg(msg);    
}
I do not check for nulls. I will add that. I suppose without that things might get pretty ugly at some point running the application.

Anything else looks wrong?

The f80ad4 signal is issued multiple times when I hold the mouse left button on the list gadget. But clicking multiple times some times did not trigger an event. Don't know if that helps.

This is why I reverted back to using IDCMP_INTUITICKS. Also something else I noticed is that this event is issued even if I did not register for it.

Quote:
Originally Posted by Thomas Richter View Post
You are doing something wrong. How exactly do you retreive the message? Note that for gadtools, you need to use GT_GetIMsg(), not GetMsg(). Also, do you check the return code for GetMsg() for NULL? Note that you need to wait for a message to arrive (either Wait() or WaitPort()).

Last edited by Sim085; 01 August 2021 at 19:37.
Sim085 is offline  
 
Page generated in 0.04297 seconds with 11 queries