|
GLG Toolkit, C / C++ API Library
Version 4.5
|
Linux only: A native GTK Widget that can be used in the GTK environment. More...
Linux only: A native GTK Widget that can be used in the GTK environment.
The widget allows embedding GLG drawings into the GTK interface hierarchy.
Creating GtkGlg Widget
To use the widget, include gtkglg.h file in your source code. The widget is created using gtk_glg_new, then using gtk_glg_set_viewport to assign the viewport that contains the widget's drawing:
The integration/gtk3_glg_native/glg_example.c directory of the GLG installation on Linux provide an example of using the GtkGlg Widget in a GTK application.
Include file: gtk_glg.h
Macros | |
| #define | GTK_GLG(obj) G_TYPE_CHECK_INSTANCE_CAST( obj, GTK_TYPE_GLG, GtkGlg ) |
| Typecast to the GtkGlg Widget. More... | |
| #define | GTK_IS_GLG(obj) ( G_TYPE_CHECK_INSTANCE_TYPE( obj, GTK_TYPE_GLG ) ) |
| Checks if the object instance is a GtkGlg Widget. More... | |
Functions | |
| void | gtk_glg_add_callback (GtkWidget *glg_widget, GlgCallbackType type, GlgCallbackProc callback, GlgAnyType client_data) |
| Adds a callback function to the widget. More... | |
| GlgObject | gtk_glg_get_viewport (GtkWidget *glg_widget) |
| Queries a viewport assigned to the widget. More... | |
| GtkWidget * | gtk_glg_new (void) |
| Creates a new GtkGlg widget. More... | |
| void | gtk_glg_set_viewport (GtkWidget *glg_widget, GlgObject viewport) |
| Assigns a drawing viewport to the widget. More... | |
| void | gtk_glg_toolkit_init (int argc, char *argv[]) |
| Optional: Initializes GLG Toolkit using applicable command-line options. More... | |
| #define GTK_GLG | ( | obj | ) | G_TYPE_CHECK_INSTANCE_CAST( obj, GTK_TYPE_GLG, GtkGlg ) |
Typecast to the GtkGlg Widget.
| obj | The object instance. |
| #define GTK_IS_GLG | ( | obj | ) | ( G_TYPE_CHECK_INSTANCE_TYPE( obj, GTK_TYPE_GLG ) ) |
Checks if the object instance is a GtkGlg Widget.
| obj | The object instance. |
| void gtk_glg_add_callback | ( | GtkWidget * | glg_widget, |
| GlgCallbackType | type, | ||
| GlgCallbackProc | callback, | ||
| GlgAnyType | client_data | ||
| ) |
Adds a callback function to the widget.
This method may be invoked at any time during the widget's lifetime. The widget will attach the callback to its viewport at the appropriate time before the viewport's drawing hierarchy as set up.
| glg_widget | The widget to add a callback to. |
| type | Specifies the type of a callback to be added:
|
| callback | Specifies a callback function to be called. |
| client_data | Specifies client data to be passed to the callback function when it is called. |
This function adds the specified callback to the widget. A callback is a user-supplied function that is called by the GLG Toolkit upon some action:
See GlgInputCallback, GlgSelectCallback, GlgTraceCallback and GlgHierarchyCallback for the description of the available callback types.
Only one callback of each callback type may be added to an individual widget. Any subsequent invocations of this function with the same callback type will overwrite the previous value of the callback.
Several callbacks may be added to different viewports on different levels of the drawing hierarchy. The GlgAddCallback function may be used to add callbacks to the children viewports inside the widget's top level viewport. However, only the first encountered callback on the lowest level of the hierarchy will be called. For example, if an input callback is attached to the widget's top level viewport and its child viewport, only the child viewport's callback will be invoked when input event occurs in the child viewport.
The viewport's ProcessMouse attribute controls processing of the mouse selection events and tooltips inside the viewport and its child viewports.
See the Callback Events section of the Handling User Input and Other Events chapter of the GLG Programming Reference Manual for more information.
| GlgObject gtk_glg_get_viewport | ( | GtkWidget * | glg_widget | ) |
Queries a viewport assigned to the widget.
| glg_widget | The widget instance. |
| GtkWidget* gtk_glg_new | ( | void | ) |
Creates a new GtkGlg widget.
| void gtk_glg_set_viewport | ( | GtkWidget * | glg_widget, |
| GlgObject | viewport | ||
| ) |
Assigns a drawing viewport to the widget.
| glg_widget | The widget instance. |
| viewport | A viewport object containing the drawing that will be displayed inside the widget. |
This function references the viewport object using GlgReferenceObject.
| void gtk_glg_toolkit_init | ( | int | argc, |
| char * | argv[] | ||
| ) |
Optional: Initializes GLG Toolkit using applicable command-line options.
| argc | Specifies the number of command line parameters. |
| argv | Specifies the command line parameter list. |