[gnome-builder] libide/tweaks: allow fetching object from builder
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/tweaks: allow fetching object from builder
- Date: Thu, 18 Aug 2022 01:04:47 +0000 (UTC)
commit 5953c783f5cff4104efef3db370e7bf294c7e967
Author: Christian Hergert <chergert redhat com>
Date: Wed Aug 17 18:02:06 2022 -0700
libide/tweaks: allow fetching object from builder
src/libide/tweaks/ide-tweaks.c | 18 ++++++++++++++++++
src/libide/tweaks/ide-tweaks.h | 3 +++
2 files changed, 21 insertions(+)
---
diff --git a/src/libide/tweaks/ide-tweaks.c b/src/libide/tweaks/ide-tweaks.c
index 8cad7b281..4619c0f49 100644
--- a/src/libide/tweaks/ide-tweaks.c
+++ b/src/libide/tweaks/ide-tweaks.c
@@ -237,3 +237,21 @@ ide_tweaks_set_project_id (IdeTweaks *self,
if (ide_set_string (&self->project_id, project_id))
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_PROJECT_ID]);
}
+
+/**
+ * ide_tweaks_get_object:
+ * @self: a #IdeTweaks
+ *
+ * Gets the object with @name.
+ *
+ * Returns: (transfer none) (nullable): a #GObject or %NULL
+ */
+GObject *
+ide_tweaks_get_object (IdeTweaks *self,
+ const char *name)
+{
+ g_return_val_if_fail (IDE_IS_TWEAKS (self), NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+
+ return gtk_builder_get_object (self->builder, name);
+}
diff --git a/src/libide/tweaks/ide-tweaks.h b/src/libide/tweaks/ide-tweaks.h
index ae99a2020..8dba534f3 100644
--- a/src/libide/tweaks/ide-tweaks.h
+++ b/src/libide/tweaks/ide-tweaks.h
@@ -45,6 +45,9 @@ void ide_tweaks_expose_object (IdeTweaks *self,
const char *name,
GObject *object);
IDE_AVAILABLE_IN_ALL
+GObject *ide_tweaks_get_object (IdeTweaks *self,
+ const char *name);
+IDE_AVAILABLE_IN_ALL
void ide_tweaks_add_callback (IdeTweaks *self,
const char *name,
GCallback callback);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]