Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-20 Thread Andrew Robinson
Hi, Just a reminder: Don't forget the Model-View-Controller architecture for GUIs. In a nutshell, all that means is you have an input, an output, and a bunch of processing that has to be done between entering an input and displaying the output. The input and the output are handled by the GUI (IUP

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-19 Thread Ranier VF
Hi, "Please ignore anyone who says "I don't need it so you can't have it" - but, obviously, it has to be a solution that causes them no pain when/if it does go in, and your proposal sounds just like that to me." I do not know if it was addressed to me. But I will answer anyway. I not agaist

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-19 Thread Pete Lomax via Iup-users
Hi there Eric, Thank you for looking at this - I just wanted to add my approval. I certainly get the point about battery life. The project I am currently working uses a background thread to handle a websocket feed, which arrives every 10s or so. While an IupTimer works, I run it at 10 times a

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-19 Thread Ranier VF
Hi, "IUP should not be the solution to every problem. It would be like incorporating a cross-platform C-runtime into IUP when that is the wrong approach. IUP is great as it is and for specialized problems it will never be able to beat a mature third party app, and right now my favorite app for the

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-19 Thread Ranier VF
Hi, "This proposal is a tiny patch to IUP, one that nobody except the implementors will notice. It does not break current behavior or create any trade offs. But it solves real problems deal with the fact that the real world uses threads, even inside the native platforms. If you don't have this

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-19 Thread Ranier VF
Hi, "I think we're in agreement here. The idea of "IupPostMessage", inspired from Windows PostMessage solves this problem elegantly. The implementation specific ways to pull this off on each platform are hidden from the user perspective." Great. "From my "Idea 2" proposal, what I'm suggesting

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-19 Thread Jörg F . Wittenberger
Eric, I'm afraid your comment bdelow does not make much sense to me. Also I did not suggest any polling. On Apr 19 2018, Eric Wing wrote: On 4/19/18, Jörg F. Wittenberger wrote: On Apr 19 2018, Eric Wing wrote: Since there seems to be so much concern and

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-19 Thread Eric Wing
On 4/19/18, Jörg F. Wittenberger wrote: > On Apr 19 2018, Eric Wing wrote: > >>Since there seems to be so much concern and speculation about the >>size, complexity, and implementation of what the patch might look >>like, I went ahead and implemented a fully

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-19 Thread Jörg F . Wittenberger
On Apr 19 2018, Eric Wing wrote: Since there seems to be so much concern and speculation about the size, complexity, and implementation of what the patch might look like, I went ahead and implemented a fully working version for Windows and GTK to provide something completely concrete to review.

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-19 Thread Jörg F . Wittenberger
On Apr 18 2018, Matt Welland wrote: On Wed, Apr 18, 2018 at 1:23 AM, Jörg F. Wittenberger < joerg.wittenber...@softeyes.net> wrote: Hi, just my two cents. On Apr 16 2018, Eric Wing wrote: This is a proposal to introduce a way to post and run events on the main UI thread. Currently (as

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-19 Thread Eric Wing
Since there seems to be so much concern and speculation about the size, complexity, and implementation of what the patch might look like, I went ahead and implemented a fully working version for Windows and GTK to provide something completely concrete to review. You can find the repo here:

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-19 Thread Jörg F . Wittenberger
Eric, sorry, you missunderstood my proposed solution. I wanted to suggest to NOT put additional events into whatever queue Iup uses behind the scenes. Instead better maintain you own queue and process this before you complete Iup's queue once using IupFlush. On Apr 18 2018, Eric Wing

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Andrew Robinson
>I agree that IUP should not be the solution to every problem. But in >this case, I strongly argue that it is the correct solution because >IUP itself already took over responsibility for the event loop. (The >moment IupMainLoop() or IupLoopStep() were created, that ship sailed.) IUP is an event

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Eric Wing
Ranier, I feel like maybe your are trying to address my concern about wanting to work on with button and not the dialog, i.e., // I want to do this: IupPostMessage(my_iup_button, 42, audio_data); // I don't want to be forced to do this IupPostMessage(some_dialog, 42,

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Eric Wing
On 4/18/18, Ranier VF wrote: > Hi, > I strong believe thar PostMessage solves the request: "update gui, outside > main thread" > Native handles, like Windows Handle, is hidden from the user perspective. > Therefore using in Windows driver and not using in GTK, IOS and

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Ranier VF
Hi, I strong believe thar PostMessage solves the request: "update gui, outside main thread" Native handles, like Windows Handle, is hidden from the user perspective. Therefore using in Windows driver and not using in GTK, IOS and Android drivers, will not disturb users. In your example, You

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Eric Wing
On 4/18/18, Eric Wing wrote: > On 4/18/18, Andrew Robinson wrote: >> IUP should not be the solution to every problem. It would be like >> incorporating a cross-platform C-runtime into IUP when that is the wrong >> approach. And just to be clear,

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Ranier VF
Hi, I strong believe thar PostMessage solves the request: "update gui, outside main thread" Native handles, like Windows Handle, is hidden from the user perspective. Therefore using in Windows driver and not using in GTK, IOS and Android drivers, will not disturb users. In your example, You

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Eric Wing
On 4/18/18, Andrew Robinson wrote: > IUP should not be the solution to every problem. It would be like > incorporating a cross-platform C-runtime into IUP when that is the wrong > approach. IUP is great as it is and for specialized problems it will never > be > able to beat a

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Andrew Robinson
IUP should not be the solution to every problem. It would be like incorporating a cross-platform C-runtime into IUP when that is the wrong approach. IUP is great as it is and for specialized problems it will never be able to beat a mature third party app, and right now my favorite app for the

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Eric Wing
On 4/18/18, Ranier VF wrote: > Hi, > Obviously I'm not saying to Call PostMessage Windows function, > in other platforms. > So I understood, only have problem is Windows Loop Event (IUP), > and the autor what do you cite, say clearly that PostThreadMessage > is wrong way

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Eric Wing
On 4/18/18, Ranier VF wrote: > Hi, > > "But in when using IUP, we can't just reasonably call Window's > PostMessage because it is not cross-platform. It won't work on any > other platform except Windows. > This whole proposal is on how to make something like PostMessage >

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Ranier VF
Hi, Obviously I'm not saying to Call PostMessage Windows function, in other platforms. So I understood, only have problem is Windows Loop Event (IUP), and the autor what do you cite, say clearly that PostThreadMessage is wrong way to solve this (update GUI in another thread). Best, Ranier

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Ranier VF
Hi, "But in when using IUP, we can't just reasonably call Window's PostMessage because it is not cross-platform. It won't work on any other platform except Windows. This whole proposal is on how to make something like PostMessage cross-platform." It's OK, but in your app example, I dont see any

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Matt Welland
On Wed, Apr 18, 2018 at 1:23 AM, Jörg F. Wittenberger < joerg.wittenber...@softeyes.net> wrote: > Hi, > > just my two cents. > > On Apr 16 2018, Eric Wing wrote: > > This is a proposal to introduce a way to post and run events on the >> main UI thread. >> >> Currently (as far as I know), IUP is

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Eric Wing
On 4/18/18, Ranier VF wrote: > Hi, > > "This is a proposal to introduce a way to post and run events on the > main UI thread." > > Just my two cents too. > > IUP Dialog have a WID (windows HWND). Why not use PostMessage and > leave Windows do work? > BOOL WINAPI

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Eric Wing
> > It's easy to see the problem you're facing. > > I'm no IUP expert, however I'm pretty positive that this can be solved > without introducing another API. > > In a similar situation I have been able to abstain from using the complete > IUP abstraction around the main loop and resort to using

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Ranier VF
Hi, "This is a proposal to introduce a way to post and run events on the main UI thread." Just my two cents too. All this is related with GUI update, in another thread, other the main thread. Then other types updates, should not interfere with IUP. IUP Dialog have a WID (windows HWND). Why not

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Ranier VF
Hi, "This is a proposal to introduce a way to post and run events on the main UI thread." Just my two cents too. All this is related with GUI update, in another thread, other the main thread. Then other types updates, should not interfere with IUP. IUP Dialog have a WID (windows HWND). Why not

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-18 Thread Jörg F . Wittenberger
Hi, just my two cents. On Apr 16 2018, Eric Wing wrote: This is a proposal to introduce a way to post and run events on the main UI thread. Currently (as far as I know), IUP is hands-off on threads. ... It's easy to see the problem you're facing. I'm no IUP expert, however I'm pretty

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-17 Thread Eric Wing
On 4/17/18, Antonio Scuri wrote: > Hi, > > I got your message. But It will take a couple of days to figure this out. > > Best, > Scuri > No problem. I know there is a lot to read over. While I think the actual implementation and impact on IUP is very small, since

Re: [Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-17 Thread Antonio Scuri
Hi, I got your message. But It will take a couple of days to figure this out. Best, Scuri 2018-04-16 16:18 GMT-03:00 Eric Wing : > This is a proposal to introduce a way to post and run events on the > main UI thread. > > Currently (as far as I know), IUP is hands-off

[Iup-users] Formal proposal for a "postMessage" API to send messages to run on the UI thread

2018-04-16 Thread Eric Wing
This is a proposal to introduce a way to post and run events on the main UI thread. Currently (as far as I know), IUP is hands-off on threads. The problem I need to solve is that there are many libraries or situations where you are on another thread, but then need to change something in the GUI