方法
GioMenuModelget_item_attribute_value
自:2.32
声明 [src]
GVariant*
g_menu_model_get_item_attribute_value (
GMenuModel* model,
gint item_index,
const gchar* attribute,
const GVariantType* expected_type
)
描述 [src]
查询在model中的item_index位置的项目所指定的attribute属性。
如果expected_type非NULL,则指定属性期望的类型。如果为NULL,则接受任何类型。
如果属性存在且匹配expected_type(或未指定期望的类型),则返回值。
如果属性不存在,或不匹配期望的类型,则返回NULL。
自:2.32
参数
item_index-
类型:
gint项目的索引。
attribute-
类型:
const gchar*要查询的属性。
数据由方法的调用者拥有。 值是一个以NUL终止的UTF-8字符串。 expected_type-
类型:
GVariantType属性的预期类型,或
NULL。该参数可以为 NULL。数据由方法的调用者拥有。
返回值
类型: GVariant
属性的值。
| 方法的调用者将拥有返回的数据的归属,并负责释放它。 |
返回值可以为NULL。 |