Submitted by Anonymous on Wed, 05/29/2002 - 06:38. Developers
I need to attach my own callback to the event that happens when you click on that fake, non-existent arrow button. If that was a real button, that shouldn`t be a problem. Too bad it isn`t.
So, how do I do that, if possible? Except, of course, determining where I`ve cliked the mouse, check if it`s within the fake arrow button and treat that from there.
Please argument your suggestion with a small piece of code.
Thank you!
regards,
Dany.
Hmmmmmm...
One way that I thought of was to attach an XmNexposeCallback to the drop down list, which IS a separate widget inside the combo box.
Unfortunately, all I got was a nice `Warning Cannot find callback list in XtAddCallback`.
Please, keep those ideas coming... )
regards,
Dany.
Problem solved! D In a very perverse way, so if you have better ideas...
The idea was to play with callbacks from the internal widgets of ComboBox, that is the textfield or the items list. Well, as it appeared that no list callbacks functioned, I tried with textfield callbacks.
To my surprise, XmNfocusCallback worked, albeit every time the fake button was pressed.
So, I added a static boolean flag to my attached callback, assuming that every time, the items list is not displayed. So, now my function is called everytime I click the fake button and by testing the value of the boolean flag, I can do stuff only when the items list is displayed.
I call this "Motif Magic"! D Don`t use Motif unless you have to! ;)
regards,
Dany.