The BonoboControlFrame object is used to embed a Control. Most
people will want to use BonoboWidget instead of the control frame
since it provides lots of nice auxiliary features to make embedding
easy.
The control frame is coupled to an embedded control and is used
to allow the Control to communicate with its environment, particuarly
getting the BonoboUIContainer for merging its menu / toolbar
UI elements.
Example 1. A nice use of a BonoboControlFrame
BonoboWidget *
bonobo_widget_construct_control_from_objref (BonoboWidget *bw,
Bonobo_Control control,
Bonobo_UIContainer uic)
{
GtkWidget *control_frame_widget;
/*
* Create a local ControlFrame for it.
*/
bw->priv->control_frame = bonobo_control_frame_new (uic);
bonobo_control_frame_bind_to_control (bw->priv->control_frame, control);
...
bonobo_control_frame_set_autoactivate (bw->priv->control_frame, TRUE);
/*
* Grab the actual widget which visually contains the remote
* Control. This is a GtkSocket, in reality.
*/
control_frame_widget = bonobo_control_frame_get_widget (bw->priv->control_frame);
/*
* Now stick it into this BonoboWidget.
*/
gtk_container_add (GTK_CONTAINER (bw),
control_frame_widget);
/*
* Always remember to show the widget before reporting bugs.
*/
gtk_widget_show (control_frame_widget);
if (uic != CORBA_OBJECT_NIL)
bw->priv->uic = bonobo_object_dup_ref (uic, NULL);
return bw;
}
Use this function when you want to embed a BonoboControl into your
container's widget hierarchy. Once you have bound the
BonoboControlFrame to a remote BonoboControl, place the widget
returned by bonobo_control_frame_get_widget() into your widget
hierarchy and the control will appear in your application.
frame :
The BonoboControlFrame whose widget is being requested.a
Returns :
A GtkWidget which has the remote BonoboControl physically
inside it.
Modifies the autoactivate behavior of control_frame. If
control_frame is set to autoactivate, then it will automatically
send an "activate" message to the Control to which it is bound when
it gets a focus-in event, and a "deactivate" message when it gets a
focus-out event. Autoactivation is off by default.
control_frame :
A BonoboControlFrame object.
autoactivate :
A flag which indicates whether or not the
ControlFrame should automatically perform activation on the Control
to which it is bound.
Makes control_frame use propbag for its ambient properties. When
control_frame's Control requests the ambient properties, it will
get them from propbag.
control_frame :
A BonoboControlFrame object.
propbag :
A BonoboPropertyBag which will hold control_frame's
ambient properties.
Changes whether or not control_frame automatically proxies
state changes to its associated control. The default mode
is for the control frame to autopropagate.
The Bonobo_UIContainer object reference associated with this
ControlFrame. This ui_container is specified when the ControlFrame is
created. See bonobo_control_frame_new().