Bonobo API Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# BonoboUIContainer

## Name

BonoboUIContainer -- The container interface as implemented for BonoboWindow

## Synopsis

    typedef     BonoboUIContainer;
    typedef     BonoboUIContainerClass;
    BonoboUIContainer* bonobo_ui_container_construct
                                                (BonoboUIContainer *container,
                                                 Bonobo_UIContainer corba_container);
    BonoboUIContainer* bonobo_ui_container_new  (void);
    BonoboUIEngine* bonobo_ui_container_get_engine
                                                (BonoboUIContainer *container);
    void        bonobo_ui_container_set_engine  (BonoboUIContainer *container,
                                                 BonoboUIEngine *engine);
    void        bonobo_ui_container_set_win     (BonoboUIContainer *container,
                                                 BonoboWindow *win);
    BonoboWindow* bonobo_ui_container_get_win   (BonoboUIContainer *container);

## Object Hierarchy

      GtkObject
       +----BonoboObject
             +----BonoboXObject
                   +----BonoboUIContainer

## Description

A BonoboUIContainer is a very thin object, it implements the CORBA interface for doing UI merging, but none of the logic. In order to achieve the effect it is associated with a BonoboUIEngine object. Traditionaly the UI container was associated with a BonoboWindow however, this is now strongly deprecated, since the BonoboUIContainer can be used with any BonoboUIEngine, not just that used by BonoboWindow.

Here is how your code should interact with the BonoboUIContainer

Example 1. How to setup a BonoboUIContainer

    {
    	BonoboWindow      *window;
    	BonoboUIEngine    *engine;
    	BonoboUIContainer *container;

    	window = BONOBO_WINDOW (
    		bonobo_window_new ("Window", "My Test Application"));
    	container = bonobo_ui_container_new();

    	engine = bonobo_window_get_ui_engine (window);
    	bonobo_ui_container_set_engine (container, engine);

    	return window;
    }

## Details

### BonoboUIContainer

    typedef struct {
    	BonoboXObject base;

    	BonoboUIContainerPrivate *priv;

    	/* For backwards compatibility, strongly deprecated */
    	BonoboWindow *win;
    } BonoboUIContainer;

### BonoboUIContainerClass

    typedef struct {
    	BonoboXObjectClass parent;

    	POA_Bonobo_UIContainer__epv epv;
    } BonoboUIContainerClass;

### bonobo_ui_container_construct ()

    BonoboUIContainer* bonobo_ui_container_construct
                                                (BonoboUIContainer *container,
                                                 Bonobo_UIContainer corba_container);

`container` : |
`corba_container` : |
Returns : |

### bonobo_ui_container_new ()

    BonoboUIContainer* bonobo_ui_container_new  (void);

Returns : | a newly created BonoboUIContainer

### bonobo_ui_container_get_engine ()

    BonoboUIEngine* bonobo_ui_container_get_engine
                                                (BonoboUIContainer *container);

Get the associated BonoboUIEngine

`container` : | the UI container
Returns : | the engine

### bonobo_ui_container_set_engine ()

    void        bonobo_ui_container_set_engine  (BonoboUIContainer *container,
                                                 BonoboUIEngine *engine);

Associates the BonoboUIContainer with a BonoboUIEngine that it will use to handle all the UI merging requests.

`container` : | the container
`engine` : | the engine

### bonobo_ui_container_set_win ()

    void        bonobo_ui_container_set_win     (BonoboUIContainer *container,
                                                 BonoboWindow *win);

This function is deprecated, please use bonobo_ui_container_set_engine instead, we plan to allow UIContainers to be associated with many things apart from BonoboWindows.

`container` : | the container
`win` : | a BonoboWindow widget

### bonobo_ui_container_get_win ()

    BonoboWindow* bonobo_ui_container_get_win   (BonoboUIContainer *container);

This is _extremely_ deprecated, there is no garentee that a BonoboUIContainer has an associated window, this function will spew warnings.

If you find yourself wanting to use this function, you probably want to be passing a BonoboWindow ( or derivative ) around and then using:

bonobo_window_get_ui_engine (window)

`container` : | the BonoboUIContainer
Returns : | a BonoboWindow if it is associated.

## See Also

BonoboUIComponent, BonoboUIEngine, BonoboWindow, BonoboUISync, bonobo-ui-util

<<< Previous Page | Home | Up | Next Page >>>
BonoboUIComponent | bonobo-ui-util