The killfocus_cb callback is the way I would choose too.
I did a similar dialog, but it contains only one element, an IupText. So I
set the killfocus_cb on the IupText only. And make sure that when the
dialog is shown the focus is set to the IupText. It works ok.
But if you have several controls inside the dialog, then this is more
complicated.
One thing that helps is to set the PARENT attribute of the dialog to the
main dialog.
Best,
Scuri
On Sun, Dec 28, 2014 at 9:07 PM, Milind Gupta <[email protected]>
wrote:
> The problem I was having was that the killfocus_cb is called before the
> getfocus_cb and when killfocus was called none of the elements in the
> dialog have focus so it may decide that it does not have focus and hide it.
>
> So currently I am creating a timer and checking every 50ms to see if any
> of the components in the dialog has focus. If none of them have it then I
> hide it, but I don't like this was too much. If there is another cleaner
> way that would be much better.
>
> I really want to create a dialog that behaves like a popup menu. The popup
> menu disappears if you click outside it, also it will disappear if the main
> application dialog closes. It is not too easy to replicate the same
> behavior for a dialog.
>
> On Fri, Dec 26, 2014 at 3:42 PM, Milind Gupta <[email protected]>
> wrote:
>
>> Hi,
>> How can I create a dialog which hides itself when it looses focus
>> i.e. when the mouse clicks anywhere except the dialog children. If any of
>> the dialog's children have focus then it should not be hidden.
>>
>> Thanks,
>> Milind
>>
>>
>>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> Iup-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users