#import <CGTKBuilder.h>
CGTKBuilder wraps GtkBuilder
| - (BOOL) addFromFile: |
|
(NSString *) |
filename |
|
The same as addFromFileWithFilename:andError: but rather than returning an error and error value this simply returns YES or NO
- Parameters
-
| filename | the name of the file to parse |
- Returns
- YES on success, NO otherwise
- See Also
- - addFromFileWithFilename:andError:
| - (NSNumber *) addFromFileWithFilename: |
|
(NSString *) |
filename |
| andError: |
|
(GError **) |
error |
|
|
| |
Parses a file containing a GtkBuilder UI definition and merges it with the current contents of builder.
Upon errors 0 will be returned and error will be assigned a GError from the GTK_BUILDER_ERROR, G_MARKUP_ERROR or G_FILE_ERROR domain.
- Parameters
-
| filename | the name of the file to parse |
| error | return location for an error, or NULL. [allow-none] |
- Returns
- A positive value on success, 0 if an error occurred
| - (BOOL) addFromStringWithBuffer: |
|
(NSString *) |
buffer |
| andLength: |
|
(gsize) |
length |
|
|
| |
The same as addFromStringWithBuffer:andLength:andError: but rather than returning an error and error value this simply returns YES or NO
- Parameters
-
| buffer | the string to parse |
| length | the length of buffer (may be -1 if buffer is nul-terminated) |
- Returns
- YES on success, NO otherwise
- See Also
- - addFromStringWithBuffer:andLength:andError:
| - (NSNumber *) addFromStringWithBuffer: |
|
(NSString *) |
buffer |
| andLength: |
|
(gsize) |
length |
| andError: |
|
(GError **) |
error |
|
|
| |
Parses a string containing a GtkBuilder UI definition and merges it with the current contents of builder.
Upon errors 0 will be returned and error will be assigned a GError from the GTK_BUILDER_ERROR or G_MARKUP_ERROR domain.
- Parameters
-
| buffer | the string to parse |
| length | the length of buffer (may be -1 if buffer is nul-terminated) |
| error | return location for an error, or NULL. [allow-none] |
- Returns
- A positive value on success, 0 if an error occurred
Gets the internal GtkBuilder
- Returns
- the internal GtkBuilder or NULL
| - (void) connectSignals: |
|
(gpointer) |
userData |
|
This method is a simpler variation of connectSignalsFullWithFunc:andUserData:. It uses GModule's introspective features (by opening the module NULL) to look at the application's symbol table. From here it tries to match the signal handler names given in the interface description with symbols in the application and connects the signals.
Note that this function will not work correctly if GModule is not supported on the platform.
When compiling applications for Windows, you must declare signal callbacks with G_MODULE_EXPORT, or they will not be put in the symbol table. On Linux and Unices, this is not necessary; applications should instead be compiled with the -Wl,–export-dynamic CFLAGS, and linked against gmodule-export-2.0.
- Parameters
-
| userData | a pointer to a structure sent in as user data to all signals |
- See Also
- - connectSignalsFullWithFunc:andUserData:
| - (void) connectSignalsFullWithFunc: |
|
(GtkBuilderConnectFunc) |
func |
| andUserData: |
|
(gpointer) |
userData |
|
|
| |
This function can be thought of the interpreted language binding version of connectSignals:, except that it does not require GModule to function correctly.
- Parameters
-
| func | the function used to connect the signals. [scope call] |
| userData | arbitrary data that will be passed to the connection function |
- See Also
- - connectSignals:
| - (void) connectSignalsToObjects: |
|
(NSDictionary *) |
objectSignalDictionary |
|
Similar to the other connect signals functions, this takes a dictionary key'd on CallbackData objects (configured with class/selectors) and their associated signals as values and connects them accordingly.
Example usage: NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys: [CallbackData withObject:[CGTK class] andSEL:(endMainLoop)], "mainQuit", [CallbackData withObject:button andSEL:(clicked)], "on_button1_activate", [CallbackData withObject:button andSEL:(clicked)], "on_button2_clicked", nil];
[builder connectSignalsToObjects:dict];
- Parameters
-
| objectSignalDictionary | A dictionary mapping CallbackData objects to NSString signal names |
| - (GObject *) getObject: |
|
(NSString *) |
name |
|
Gets the object named name. Note that this function does not increment the reference count of the returned object.
- Parameters
-
| name | name of object to get |
- Returns
- the object named name or NULL if it could not be found in the object tree. [transfer none]
Gets all objects that have been constructed by builder. Note that this function does not increment the reference counts of the returned objects.
- Returns
- a newly-allocated GSList containing all the objects constructed by the GtkBuilder instance. It should be freed by g_slist_free(). [element-type GObject][transfer container]
| - (NSString *) getTranslationDomain |
|
|
|
Gets the translation domain of builder.
- Returns
- the translation domain. This string is owned by the builder object and must not be modified or freed.
| - (GType) getTypeFromName: |
|
(NSString *) |
typeName |
|
Looks up a type by name, using the virtual function that GtkBuilder has for that purpose. This is mainly used when implementing the GtkBuildable interface on a type.
- Parameters
-
| typeName | type name to lookup |
- Returns
- the GType found for type_name or G_TYPE_INVALID if no type was found
| - (CGTKWidget *) getWidgetWithName: |
|
(NSString *) |
name |
|
Attempts to get the object witht he name returning it as a CGTKWidget. If the object is not found or not compatible with CGTKWidget this will return nil.
- Parameters
-
| name | the name of the object to return |
- Returns
- the CGTKWidget or nil
| + (void) setDebug: |
|
(BOOL) |
debugEnabled |
|
When enabled this builder will print out signal connection debug info
| - (void) setTranslationDomain: |
|
(NSString *) |
domain |
|
Sets the translation domain of builder. See "translation-domain".
- Parameters
-
| domain | the translation domain or NULL. [allow-none] |
| - (BOOL) valueFromStringTypeWithType: |
|
(GType) |
type |
| andString: |
|
(NSString *) |
string |
| andValue: |
|
(GValue *) |
value |
| andError: |
|
(GError **) |
error |
|
|
| |
Like valueFromStringWithPspec:andString:andValue:andError:, this function demarshals a value from a string, but takes a GType instead of GParamSpec. This function calls g_value_init() on the value argument, so it need not be initialised beforehand.
This function can handle char, uchar, boolean, int, uint, long, ulong, enum, flags, float, double, string, GdkColor and GtkAdjustment type values. Support for GtkWidget type values is still to come.
Upon errors NO will be returned and error will be assigned a GError from the GTK_BUILDER_ERROR domain.
- Parameters
-
| type | the GType of the value |
| string | the string representation of the value |
| value | the GValue to store the result in. [out] |
| error | return location for an errorgtk_builder_value_from_string , or NULL. [allow-none] |
- Returns
- YES on success
- See Also
- - valueFromStringWithPspec:andString:andValue:andError:
| - (BOOL) valueFromStringWithPspec: |
|
(GParamSpec *) |
pspec |
| andString: |
|
(NSString *) |
string |
| andValue: |
|
(GValue *) |
value |
| andError: |
|
(GError **) |
error |
|
|
| |
This function demarshals a value from a string. This function calls g_value_init() on the value argument, so it need not be initialised beforehand.
This function can handle char, uchar, boolean, int, uint, long, ulong, enum, flags, float, double, string, GdkColor and GtkAdjustment type values. Support for GtkWidget type values is still to come.
Upon errors NO will be returned and error will be assigned a GError from the GTK_BUILDER_ERROR domain.
- Parameters
-
| pspec | the GParamSpec for the property |
| string | the string representation of the value |
| value | the GValue to store the result in. [out] |
| error | return location for an errorgtk_builder_value_from_string , or NULL. [allow-none] |
- Returns
- YES on success
The documentation for this class was generated from the following file: