Boost logo

Boost :

Subject: Re: [boost] [ANN] Boost.UI - a new C++ GUI library
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-09-28 22:06:07

>>> I don't like the fact that it introduces its own event loop that I have no
>>> control on.
>> This loop is designed to interact with user, all GUI librararies have
>> it. When user press button key he should wait while your loop have a
>> time to handle users request?
> I haven't looked over your library at all yet, but I have bumped into
> the problem of trying to integrate application code with an
> inaccessible main loop.
> Instead of providing your own main loop, you might consider using an
> Asio io_service as your main event loop, and exposing (a subset of)
> its API to your own library consumers. That would give you a certain
> level of extensibility right out of the box.

Another option is to copy AFIO's io_service design

- Don't implement a main loop, implement a function e.g. run() which
dispatches exactly one pending event, returning true if there was an
event processed.
- Said run() also comes in run_until(deadline) form, where deadline can
be "now" i.e. poll for an event, if one present dispatch it, else return
- A post() routine lets any thread cause some user supplied callable to
be executed in the run().

Thence the programmer may write:

// Dispatch events, blocking if no new events, returning false if
// no work pending.

Or they might write:

// Polling implementation, exits loop if no work pending
  do other work;

The point is to open up your event dispatch so it can coexist with
whatever existing system the user is already using.


ned Productions Limited Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at