On Mon, 24 May 1999, Matthias Ettrich wrote: > On Tue, 25 May 1999, Mosfet wrote: > > It's already in kdelibs/corba/parts ;-) > > But not this vastly improved version :-) > > > > I would prefer it in kdeui tho, since I could use it for non-OP stuff I am > > doing (I am using XReparentWindow currently). > > Great. One usage tip (the documentation is not yet finished): Use qxembed from > the client side and not from the server side. That means: not the embedding > widget does the reparenting but vice versa: the client-module embeds itself. > Ah, okay. That is kindof neat :) > This is trivial with qxembed. Here's a tiny example of a standalone qxembed > widget that will embed a qmultilineedit as client. > > First the server: > > #include > #include > #include > > int main( int argc, char **argv ) > { > QApplication a( argc, argv ); > QXEmbed qx; > a.setMainWidget( &qx ); > qx.show(); > QApplication::flushX(); > if ( !fork() ) > execlp("client_program", "client_program", > "-embed", QString::number(qx.winId()).latin1(), > 0); > return a.exec(); > } > > > If you wonder about the flushX(), that's to avoid Xlib getting out of sync with > two processes. Unlikely but might happen. > > And here's the applet, a simple qmultlineedit: > > #include > #include > #include "qxembed.h" > > int main( int argc, char **argv ) > { > QApplication a( argc, argv ); > QMultiLineEdit me; > a.setMainWidget( &me ); > if ( !QXEmbed::processClientCmdline( &me, argc, argv ) ) > me.show(); > return a.exec(); > } > > > Cute, isn't it? :-) > > Note that you *need* tomorrows Qt-2.0 snapshot to get this working properly. > The public Qt CVS will be updated in a few hours, to be precise. > > > Matthias -- Daniel M. Duley - Unix developer & sys admin. mosfet@kde.org mosfet@jorsm.com