Intuition On Click Event?
I have gone through the documentation and cannot understand what I am doing wrong. Hopefully someone can help.
I have a window with a list and a text field. I want the focus to remain always in the text field regardless where the user clicks.
At first I thought of using IDCMP_INTUITICKS event and use ActivateGadget on each tick. However I was never much in love with the idea as this means calling ActivateGadget for the text field even when this is already in focus.
I therefore opted to instead only call ActivateGadget when the list is clicked or when the window is clicked. I thought the easiest way to do this is to listen for the IDCMP_MOUSEBUTTONS event (SELECTDOWN). This does work when clicking on the window, but not when clicking in the window title bar or the list.
So in addition to IDCMP_MOUSEBUTTONS I also listen to IDCMP_GADGETUP. When I receive the event I check if the event is for my list and if so I use ActivateGadget on the text field. This works for this list but ONLY WHEN the list actually has an entry in it. If the list is empty then no IDCMP_GADGETUP event is triggered.
So far I have not found how to capture an on click event on the title bar.
Does anyone have any idea how I can capture an on click event on the title bar and a list (when this is empty)?
|