| [reply] |
Thank you, I am OK with socket programming. My question is: how do I blend the socket server with the GTK3 main loop?
What I am trying to do is to use the GTK3 window as a display attached to a server that receives messages and changes the display to what the messages say needs to be displayed.
Additionally, I'd like to have a button in GTK3 which would allow a user to select something.
| [reply] |
Disclaimer: This is still just from quick Googling, I actually haven't done this myself, but I hope these pointers help. It looks to me like you would set up a GSocketService which has an incoming event, get the GSocketConnection's GSocket file descriptor, and then register that with a GIOChannel via g_io_add_watch. It also appears that one can write a handler for the client in a blocking manner in a separate thread via GThreadedSocketService.
| [reply] [d/l] [select] |
As an example:
I have a GTK3 display that displays 3 choices:
Cats
Dogs
Rats
However the backend system (another program) finds we are out of Rats, we do, however, have scorpions. The backend system contacts the display and sends a message "change the third button to Scorpions", without any user interaction at the display. The result:
Cats
Dogs
Scorpions
| [reply] |
| [reply] |