Re: [gtkmm] combining GTK with TAO



Li,

I do it this way:

1) Setup and idle work callback with with Gtkmm event loop.

2) From the idle callback, call TAO event loop to process all
   pending work:

   #include <tao/corba.h>

   class MainWindow {
   public:
       MainWindow();
	   int init_orb();
	   void run_orb_iteration();	
	   void orb_shutdown();

   private:
       CORBA::ORB_ptr    m_orb;
   };

   MainWindow::
   MainWindow () : m_orb (CORBA::ORB::_nil()) { ... }

   int 
   MainWindow::
   init_orb ()
   {
       ...
	   m_orb = CORBA::ORB_init (orbargc, orbargv);
	   ...
   }

   void
   MainWindow::
   run_orb_iteration ()
   {   
       /* ORB event loop iteration */
       if (!CORBA::is_nil (m_orb)) {
	       if (m_orb->work_pending ()) {
	           m_orb->perform_work (); 
	       }
       }   
   }      

   void
   MainWindow::
   orb_shutdown ()
   {
       if (!CORBA::is_nil (m_orb)) {
	       m_orb->destroy ();
	       m_orb = 0;
       }
   }

hope this helps,
Vlad

On Tue, Dec 09, 2003 at 02:45:28PM +0100, Li Wenfeng wrote:
> Hi All,
> 
> I am wondering if I can combine GTK event loog with TAO event loop to 
> develop a GUI for TAO server and client. Does anyone have this 
> experience? Any help would be appreciated.
> 
> Aaron.
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list

-- 
______________________________________________________
Vladislav Grinchenko    e-mail (w): vgrinche integ com
Software Engineer            (h): 3rdshift comcast net
Integral Systems, Inc.

   Focus on quality, and productivity will follow.
______________________________________________________



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]