Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dorota Czaplejewicz
gtk
Commits
9794b6ad
Commit
9794b6ad
authored
Mar 12, 2010
by
Carlos Garnacho
Browse files
GtkWidget: Add gtk_widget_get_path().
This function composes and returns a GtkWidgetPath representing the passed widget.
parent
61360dfd
Changes
2
Hide whitespace changes
Inline
Side-by-side
gtk/gtkwidget.c
View file @
9794b6ad
...
...
@@ -13165,6 +13165,27 @@ _gtk_widget_set_height_request_needed (GtkWidget *widget,
widget
->
priv
->
height_request_needed
=
height_request_needed
;
}
GtkWidgetPath
*
gtk_widget_get_path
(
GtkWidget
*
widget
)
{
GtkWidgetPath
*
path
;
g_return_val_if_fail
(
GTK_IS_WIDGET
(
widget
),
NULL
);
g_return_val_if_fail
(
GTK_WIDGET_REALIZED
(
widget
),
NULL
);
path
=
gtk_widget_path_new
();
while
(
widget
)
{
gtk_widget_path_prepend_widget_desc
(
path
,
G_OBJECT_TYPE
(
widget
),
widget
->
name
);
widget
=
widget
->
parent
;
}
return
path
;
}
GtkStyleContext
*
gtk_widget_get_style_context
(
GtkWidget
*
widget
)
{
...
...
@@ -13178,7 +13199,8 @@ gtk_widget_get_style_context (GtkWidget *widget)
if
(
G_UNLIKELY
(
!
context
))
{
context
=
g_object_new
(
GTK_TYPE_STYLE_CONTEXT
,
NULL
);
g_object_set_qdata_full
(
widget
,
quark_style_context
,
context
,
g_object_set_qdata_full
(
G_OBJECT
(
widget
),
quark_style_context
,
context
,
(
GDestroyNotify
)
g_object_unref
);
}
...
...
gtk/gtkwidget.h
View file @
9794b6ad
...
...
@@ -37,6 +37,7 @@
#include <gtk/gtkstyle.h>
#include <gtk/gtksettings.h>
#include <gtk/gtkstylecontext.h>
#include <gtk/gtkwidgetpath.h>
#include <atk/atk.h>
G_BEGIN_DECLS
...
...
@@ -944,6 +945,8 @@ gboolean gtk_widget_in_destruction (GtkWidget *widget);
GtkStyleContext
*
gtk_widget_get_style_context
(
GtkWidget
*
widget
);
GtkWidgetPath
*
gtk_widget_get_path
(
GtkWidget
*
widget
);
G_END_DECLS
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment