Dear GTK+ people!
I have a feature request for you:
Could you provide a
gdk_init_on_display(Display* display)
or
gtk_init_on_display(Display* display)
method?
We need this in the LyX team when we want to port LyX to use GTK+. In the
transition phase, we want to link to both XForms and GTK+, but that seems to be
impossible without this feature. Details on why explained below.
Thanks for considering it.
Greets,
Asger Alstrup
P.S. Please cc any replies to [EMAIL PROTECTED], because I'm not
subscribed to your list.
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Toolkits coexistence
> Date: 2. april 1999 04:02
>
> The present plan of the toolkit independence assumes that there is a
> transition stage of toolkits coexistence. Unfortunately I found that
> none, except for one, namely xforms, toolkits are written for such
> a situation in mind, it causes a nasty unreliable event loop handling.
> As I proposed a few months ago, it is possible to merge multiple event
> loops, essentially as follows,
>
> void LyXGUI::runTime()
> {
> if (!gui)
> return;
>
> fd_set rset, wset, eset;
> int maxfd;
> FD_ZERO(&rset);
> FD_ZERO(&wset);
> FD_ZERO(&eset);
>
> // Here comes the probelmatic lines!
> maxfd = ConnectionNumber(display);
> FD_SET(maxfd, &rset);
>
> while (!finished) {
> int count = select(1 + maxfd, &rset, &wset, &eset, NULL);
> for (count; count >0; count--) {
> // There must be error checks here.
> fl_check_forms();
> gtk_main_iteration_do(FALSE);
> QApplication::processNextEvent(FALSE);
> }
> }
> }
>
> What's wrong with the above is now obvious. We have *multiple*
> connections to the same X server! A quick fix like
>
> int fl_fd = ConnectionNumber(fl_display);
> int gdk_fd = ConnectionNumber(gdk_display);
> FD_SET(fl_fd, &rset);
> FD_SET(gdk_fd, &rset);
> maxfd = ((fl_fd > gdk_fd) ? fl_fd : gdk_fd);
>
> makes the event loop very unreliable. kLyX works becuase Qt has
>
> QApplication::QApplication( Display* dpy )
>
> But both gdk_init() and fl_initialize() call XOpenDisplay() and
> there is neither gdk_init_on_display(Display* display) nor
> gtk_init_on_display(Display* display).
>
> Is it not possible to request such feature in gtk?
>
> Regards,
> SMiyata