Just to reinforce what's in the documentation. All the GUI toolkits, as
far as I know, are limited to calls only at the main application thread.
This is for multi-threaded applications where threads are created with
pthread or any similar toolkit.

  It is not related with main or secondary message loops. The Windows SDK
nomenclature can be very confusing sometimes and it uses the name threads
for the main loop, but it is not in the same context as multi-threaded
applications. The secondary main loops used for IupPopup or any other
situation are all still in the same thread of the main loop.

Best,
Scuri


Em seg, 8 de jul de 2019 às 07:20, Simon Orde <
simono...@family-historian.co.uk> escreveu:

> Matt said “I gather it's not safe to call IUP functions from a NON IUP
> main-loop thread”.  Is that right?  Where did you hear this?  I’m trying
> to call IUP functions from a Lua script running within the main-loop
> thread, and in various circumstances it is causing my application to close
> because IUP shuts down the entire thread when it exits - see my post “IUP
> crash in Debug Mode” (doesn’t just affect Debug Mode incidentally).  Is
> this the issue you are referring to?  If so, is there any other solution to
> it that you know of?  Because I can’t run IUP on a second thread.  I have
> to run it on the main-loop thread.
>
>
>
> Simon
>
>
>
>
>
> *From:* Matthew Kennedy [mailto:burnsid...@gmail.com]
> *Sent:* 04 July 2019 7:18 PM
> *To:* iup-users@lists.sourceforge.net
> *Subject:* [Iup-users] using IDLE_ACTION with threads
>
>
>
> Hi,
>
>
>
> I've trawled through the mailing list archives trying to research this. I
> hope I haven't missed a solution to this already:
>
>
>
> I have IUP's main-loop running on thread, and I have another thread that
> needs to update something in the GUI. I gather it's not safe to call IUP
> functions from a NON IUP main-loop thread, so I've settled on acquiring a
> lock on and setting the IUP idle function to a function that includes the
> work needed to be performed by the non IUP main-loop thread (returning
> IUP_IGNORE, so as to run once).
>
>
>
> This works pretty well, but I believe if the NON IUP main-loop thread sets
> IUP idle function faster than the idle function is called by IUP, then my
> IUP idle functions will not always be called. Is there a way to set the
> idle function and wait for it to be called? Or even some way to set the
> idle function and trigger it to run immediately?
>
>
>
> Matt
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to