Re: watching a file descriptor in gtk3

2017-01-23 Thread rbd
Eric (cecas...@aol.com) sent me the following earlier today in response to another discussion thread I started a few days ago re: GSubProcess: I put together a test example of GSubprocess. ... https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Pipes/gnuplot5.c In an

Re: watching a file descriptor in gtk3

2017-01-23 Thread Chris Vine
On Mon, 23 Jan 2017 22:18:19 + Emmanuele Bassi wrote: > Hi; > > On 23 January 2017 at 22:09, rbd wrote: > > >> It is not quite that bad. The documentation for > >> g_source_add_unix_fd() is inadequate, but although not immediately > >> obvious the

Re: watching a file descriptor in gtk3

2017-01-23 Thread rbd
Hi Emmanuele, Thanks for the additional documentation references! They were generally informative, although I think the one you mentioned as being apropos of my particular case was actually designed to be used for a source specifically other than file descriptors -- it was useful

Re: watching a file descriptor in gtk3

2017-01-23 Thread Emmanuele Bassi
Hi; On 23 January 2017 at 22:09, rbd wrote: >> It is not quite that bad. The documentation for g_source_add_unix_fd() >> is inadequate, but although not immediately obvious the prepare, check >> and finalize handlers can in fact usually just be set to NULL (provided >>

Re: watching a file descriptor in gtk3

2017-01-23 Thread rbd
Thanks for all the further explication, Chris! The problem is that the main loop would enter a busy loop. Well, maybe a 'busy-ish' loop. If you call up g_idle_add() with a repeating callback (one which returns TRUE) which does nothing except examine a non-blocking select(), you will end up

Re: watching a file descriptor in gtk3

2017-01-23 Thread Chris Vine
On Mon, 23 Jan 2017 09:30:17 -1000 (HST) rbd wrote: > Hi Chris, > > Thanks very much for all of that information -- it was very helpful! > > >> I do not fully understand your question (especially I don't > >> understand your reference to using "g_idle_add_full() and do my

Re: gtk3 and fork/exec of non-gtk child

2017-01-23 Thread rbd
Hi Roger, I put together a test example of GSubprocess. It starts Gnuplot, sets up the pipes and callbacks, and then when Gnuplot is done it opens the graph in an image widget. The GSubprocess will take care of the file descripters for you. ...

Re: watching a file descriptor in gtk3

2017-01-23 Thread rbd
Hi Chris, Thanks very much for all of that information -- it was very helpful! I do not fully understand your question (especially I don't understand your reference to using "g_idle_add_full() and do my own non-blocking select() inside my callback", which would not work), ... I won't be

Re: watching a file descriptor in gtk3

2017-01-23 Thread Eric Cashon via gtk-app-devel-list
Hi Roger, I put together a test example of GSubprocess. It starts Gnuplot, sets up the pipes and callbacks, and then when Gnuplot is done it opens the graph in an image widget. The GSubprocess will take care of the file descripters for you. Also, if I run valgrind with multiple plots being

How to replace gdk_screen_get_monitor_at_window?

2017-01-23 Thread zahlenmeer
I am specifically interested in the number of the monitor, which is returned by gdk_screen_get_monitor_at_window. However, its advertised replacement gdk_display_get_monitor_at_window only returns the pointer to the monitor. My try would be: gint display_helper_get_monitor_num_at_window

Re: watching a file descriptor in gtk3

2017-01-23 Thread Chris Vine
On Mon, 23 Jan 2017 00:29:46 + Chris Vine wrote: [snip] > I do not fully understand your question (especially I don't understand > your reference to using "g_idle_add_full() and do my own non-blocking > select() inside my callback", which would not work), but you