Antonio,
I've actually made some progress in this area. Is there an easy way that
I can add my thread ID to the callback? Here is the code I'm using now.
I have to use this method as IupSetCallback() doesn't allow me to get
the 'class name' for the control that generated the event.
besFUNCTION(PuiSetCallback)
Ihandle *ih;
const char *name;
char *class_name;
besARGUMENTS("pz")
&ih, &name
besARGEND
class_name = IupGetClassName(ih);
if (strcmp(class_name, "dialog") == 0) {
/* IupSetCallback(ih, name, (Icallback)&WinEvent); */
IupSetFunction(name, (Icallback)&WinEvent);
IupSetAttribute(ih, name, name);
}
else if (strcmp(class_name, "button") == 0) {
/* IupSetCallback(ih, name, (Icallback)&BtnEvent); */
IupSetFunction(name, (Icallback)&BtnEvent);
IupSetAttribute(ih, name, name);
}
else if (strcmp(class_name, "list") == 0) {
/* IupSetCallback(ih, name, (Icallback)&ListEvent); */
IupSetFunction(name, (Icallback)&ListEvent);
IupSetAttribute(ih, name, name);
}
else {
/* IupSetCallback(ih, name, (Icallback)&Event); */
IupSetFunction(name, (Icallback)&Event);
IupSetAttribute(ih, name, name);
}
besRETURN_STRING(class_name);
besEND
On Wed, 2015-05-20 at 08:51 -0300, Antonio Scuri wrote:
> No, sorry.
>
>
> Best,
> Scuri
>
>
>
> On Wed, May 20, 2015 at 2:47 AM, John Spikowski
> <[email protected]> wrote:
> Hi List,
>
> Antonio posted before I was a member of the list a follow up
> request
> about using IUP in a threaded environment. I noticed an
> encouraging post
> by "Otfried" that under Linux this is a walk in the park.
>
> "Note that in GTK this is really easy to achieve: GLib is
> thread-safe,
> and so you can simply call g_idle_add from your worker thread
> to
> register an idle callback. The idle callback will then be
> called from
> the GTK main loop in the IUP thread (since IUP simply uses the
> GTK main
> loop, all this should work seamlessly without any modification
> to IUP)."
>
> Is there a C example of this working I can try?
>
>
> John Spikowski
> Script BASIC Project Manager
> www.scriptbasic.org
>
>
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across
> Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you
> Actionable Insights
> Deep dive visibility with transaction tracing using APM
> Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Iup-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Iup-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/iup-users
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users