LINUX programming

Moderators: ITA
Number of threads: 1339
Number of posts: 2924

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Gtk Socket, Plug, embeding one program into another. Posted by arkashkin on 26 Mar 2010 at 5:17 AM
Hello,
I'm trying to embed some program into another using the plug and socket mechanism. From the examples which I have found on the Internet all the widgets of program A are placed into the plug and then the plug is connect into the socket of program B and then A appears inside B.
I'm trying to make the same as with A in Glade (program for designing gtk gui) so it would embed into some IDE, does it means I need to create a plug and move all of it's window's widgets into the plug?

Here is the original code in Glade where I want to create the plug:
glade_window_init (GladeWindow *window)
{
	GladeWindowPrivate *priv;

	GtkWidget *vbox;
	GtkWidget *hpaned1;
	GtkWidget *hpaned2;
	GtkWidget *vpaned;
	GtkWidget *menubar;
	GtkWidget *palette;
	GtkWidget *dockitem;
	GtkWidget *widget;
	GtkWidget *sep;
	GtkAction *undo_action, *redo_action;
	GtkAccelGroup *accel_group;	

	window->priv = priv = GLADE_WINDOW_GET_PRIVATE (window);
	
	priv->default_path = NULL;
	
	priv->app = glade_app_new ();

	vbox = gtk_vbox_new (FALSE, 0);
	gtk_container_add (GTK_CONTAINER (window), vbox);
        .....................
        .....................
}


So from the original code you can see that Vbox is created inside the Window and the
rest of the widgets are created inside the Vbox.

Now, I need to create a plug so I can embed this program to another.

So I have looked on a few examples to do so and they all look similar to this:
 	GtkWidget *plug;
	plug = gtk_plug_new (sock);
	gtk_container_add (GTK_CONTAINER (plug), vbox);
 	gtk_widget_show ( plug );


The Vbox is added inside the plug and all other widget are inside the Vbox.
this code is working great but I don't know how to modify Glade's code to work like this.

The problem is that in Glade's code there is a Window widget, all of Glade's code depends on it to be a Window, so I can't put the Vbox inside the plug.

Maybe some one could help me with this?



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.