So the way I am using it now is with killfocus_cb and a timer to check if
any element still has focus. If not then I hide the dialog in the timer
call back. One issue is that if the dialog opens over the main dialog and I
click the main dialog cross and close it this dialog remains open probably
because by the time the timer call back was executed the focus came back to
this dialog. So now when exiting the main dialog I have to exit it using
iup.close()
On Mon, Dec 29, 2014 at 9:02 AM, Antonio Scuri <[email protected]>
wrote:
> 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
>
>
------------------------------------------------------------------------------
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