Copyright (C) 2000-2012 |
GNU Info (gtk.info)ObjectsObjects ******* Object functions ================ The GtkObject type is the root of the type hierarchy used by GTK. It provides a minimal set of fields used to implement the actual object, class and signal mechanisms, as well as several utility routines which make dealing with objects easier. For the adventurous, see Note: Object Implementation. - Function: guint gtk_object_get_type (void) Returns the `GtkObject' type identifier. - Function: void gtk_object_class_add_signals (GtkObjectClass *CLASS, gint *SIGNALS, gint NSIGNALS) Adds SIGNALS to the `signals' field in the GtkObjectClass structure CLASS. Note: Signals. - Function: GtkObject* gtk_object_new (guint TYPE, ...) - Function: GtkObject* gtk_object_newv (guint TYPE, guint NARGS, GtkArg *ARGS) - Function: void gtk_object_ref (GtkObject *OBJECT); - Function: void gtk_object_unref (GtkObject *OBJECT); - Function: void gtk_object_getv (GtkObject *OBJECT, guint NARGS, GtkArg *ARGS) - Function: void gtk_object_set (GtkObject *OBJECT, ...) - Function: void gtk_object_setv (GtkObject *OBJECT, guint NARGS, GtkArg *ARGS) - Function: GtkArg* gtk_object_query_args (GtkType CLASS_TYPE, guint *NARGS) - Function: void gtk_object_add_arg_type (gchar *ARG_NAME, GtkType ARG_TYPE, guint ARG_ID) - Function: GtkType gtk_object_get_arg_type (gchar *ARG_NAME) - Function: void gtk_object_destroy (GtkObject *OBJECT) Performs checks to make sure it is alright to destroy OBJECT and then emits the `destroy' signal. The check which is performed is to make sure OBJECT is not already processing another signal. If this were the case then destroying the object immediately would undoubtedly cause problems as the other signal would not be able to tell the object was destroyed. The solution is that if OBJECT is processing another signal we mark OBJECT is needing to be destroyed. When we finish processing of the other signal we check whether the object needs to be destroyed. The GtkObject type provides a mechanism for associating arbitrary amounts of data with an object. The data is associated with the object using a character string key. The functions `gtk_object_set_data', `gtk_object_get_data', and `gtk_object_remove_data' are the interface to this mechanism. Two other routines, `gtk_object_set_user_data' and `gtk_object_get_user_data', exist as convenience functions which simply use the same mechanism. - Function: void gtk_object_set_data (GtkObject *OBJECT, const char *KEY, gpointer DATA) Associate DATA with KEY in the data list of OBJECT. - Function: gpointer gtk_object_get_data (GtkObject *OBJECT, const char *KEY) Retrieve the data associated with KEY in the data list of OBJECT. - Function: void gtk_object_remove_data (GtkObject *OBJECT, const char *KEY) Remove the data associated with KEY in the data list of OBJECT. - Function: void gtk_object_set_user_data (GtkObject *OBJECT, gpointer DATA) Sets DATA into the `user_data' field of OBJECT. - Function: gpointer gtk_object_get_user_data (GtkObject *OBJECT) Returns the `user_data' field of OBJECT. The GtkObject type also provides a mechanism for specifying initialization values for fields. This general mechanism is called object value stacks. The reason for using value stacks is that they can simplify the life of the programmer. For instance, by default widgets are non-visible when created. However, the "visible" value for widgets may be specified so that widgets are made visible when created. (FIXME: unfinished). - Function: void gtk_object_value_stack_new (guint OBJECT_TYPE, const gchar *VALUE_ID, GtkParamType VALUE_TYPE) - Function: void gtk_object_push_value (guint OBJECT_TYPE, const gchar *VALUE_ID, ...) Push a value on the value stack specified by OBJECT_TYPE and VALUE_ID. The type of value is implicitly given in the context of OBJECT_TYPE and VALUE_ID. (That is, it is not specified explicitly in the function call). Only a single extra argument is expected which is the data which is to be placed on the stack. - Function: void gtk_object_pop_value (guint OBJECT_TYPE, const gchar *VALUE_ID) Pop a value of the value stack specified by OBJECT_TYPE and VALUE_ID. - Function: gint gtk_object_peek_value (guint OBJECT_TYPE, const gchar *VALUE_ID, gpointer DATA) Peek at the value on the top of the value stack specified by OBJECT_TYPE and VALUE_ID. The DATA argument is interpreted as the location of where to place the "peeked" data. For instance, if the peeked data is of type `GTK_PARAM_POINTER', then DATA will be a pointer to a pointer. If the value stack is empty or does not exist or an error occurs, `gtk_object_peek_value' will return `FALSE'. On success it will return `TRUE'. automatically generated by info2www version 1.2.2.9 |