Bonobo API Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
GtkWidget* bonobo_window_construct (BonoboWindow *win, const char *win_name, const char *title); GtkWidget* bonobo_window_new (const char *win_name, const char *title); void bonobo_window_set_contents (BonoboWindow *win, GtkWidget *contents); GtkWidget* bonobo_window_get_contents (BonoboWindow *win); void bonobo_window_set_name (BonoboWindow *win, const char *win_name); char* bonobo_window_get_name (BonoboWindow *win); GtkAccelGroup* bonobo_window_get_accel_group (BonoboWindow *win); void bonobo_window_add_popup (BonoboWindow *win, GtkMenu *popup, const char *path); void bonobo_window_remove_popup (BonoboWindow *win, const char *path); BonoboUIEngine* bonobo_window_get_ui_engine (BonoboWindow *win); |
The BonoboWindow class uses a BonoboUIEngine, in combination with several BonoboUISync classes to achieve a powerful new top-level window widget. It's API mandates the use of XML to specify your UI, it also strongly encourages the use of the BonoboUIComponent API to create even the top-level UI. This incurs almost no penalty since ORBit's CORBA implementation is extremely fast in-processes. This in turn encourages people to ensure that even their top-level components are capable of being used as controls with minimal effort.
Example 1. Creating a BonoboWindow
BonoboUIContainer *ui_container; BonoboUIComponent *ui_component; BonoboWindow *win; win = BONOBO_WINDOW ( bonobo_window_new ("Win", "My Test Application")); ui_container = bonobo_ui_container_new(); bonobo_ui_container_set_win (ui_container, win); bonobo_ui_engine_config_set_path ( bonobo_window_get_ui_engine (win), "/my-application-name/UIConfig/kvps"); |
Example 2. Setting up the window UI
ui_component = bonobo_ui_component_new ("my-app"); /* Associate the BonoboUIComponent with the container */ bonobo_ui_component_set_container ( ui_component, BONOBO_OBJREF (ui_container); bonobo_ui_util_set_ui ( ui_component, MY_COMPILE_TIME_PREFIX, "GNOME_MyApp.ui", "my-app"); |
GtkWidget* bonobo_window_construct (BonoboWindow *win, const char *win_name, const char *title); |
Construct a new BonoboWindow
void bonobo_window_set_contents (BonoboWindow *win, GtkWidget *contents); |
Insert a widget into the main window contents.
void bonobo_window_set_name (BonoboWindow *win, const char *win_name); |
Set the name of the window - used for configuration serialization.
char* bonobo_window_get_name (BonoboWindow *win); |
Gets the name of a window.
void bonobo_window_add_popup (BonoboWindow *win, GtkMenu *popup, const char *path); |
Add a popup menu at path
void bonobo_window_remove_popup (BonoboWindow *win, const char *path); |
Remove the popup at path