diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2010-07-16 11:14:21 -0400 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2010-07-16 11:14:21 -0400 |
| commit | 65d8d28cf443771acfc6bb09bf91422d351010b4 (patch) | |
| tree | bf0cd13ce92a27d881cafdc5ba1e813efda3ebe8 | |
| parent | 6e777a0bbb6c7ff9f8088139ffb4faeb1156876f (diff) | |
kernelshark: Add compat gtk_menu_item_get_label() function
The gtk_menu_item_get_label() function was implemented in gtk 2.16.
This adds the compat function for building kernelshark against
gtk earlier than 2.16.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| -rw-r--r-- | trace-compat.c | 9 | ||||
| -rw-r--r-- | trace-compat.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/trace-compat.c b/trace-compat.c index e1652e0..cd939b3 100644 --- a/trace-compat.c +++ b/trace-compat.c | |||
| @@ -45,6 +45,15 @@ void gtk_cell_renderer_get_padding(GtkCellRenderer *cell, | |||
| 45 | 45 | ||
| 46 | #if GTK_VERSION < CALC_GTK_VERSION(2,16,0) | 46 | #if GTK_VERSION < CALC_GTK_VERSION(2,16,0) |
| 47 | 47 | ||
| 48 | const gchar *gtk_menu_item_get_label(GtkMenuItem *menu_item) | ||
| 49 | { | ||
| 50 | g_return_val_if_fail(GTK_IS_MENU_ITEM(menu_item), NULL); | ||
| 51 | |||
| 52 | if (GTK_IS_LABEL(GTK_BIN(menu_item)->child)) | ||
| 53 | return gtk_label_get_label(GTK_LABEL(GTK_BIN(menu_item)->child)); | ||
| 54 | return NULL; | ||
| 55 | } | ||
| 56 | |||
| 48 | void gtk_menu_item_set_label(GtkMenuItem *menu_item, const gchar *label) | 57 | void gtk_menu_item_set_label(GtkMenuItem *menu_item, const gchar *label) |
| 49 | { | 58 | { |
| 50 | g_return_if_fail(GTK_IS_MENU_ITEM(menu_item)); | 59 | g_return_if_fail(GTK_IS_MENU_ITEM(menu_item)); |
diff --git a/trace-compat.h b/trace-compat.h index ce7759d..7795678 100644 --- a/trace-compat.h +++ b/trace-compat.h | |||
| @@ -35,6 +35,7 @@ void gtk_cell_renderer_get_padding(GtkCellRenderer *cell, | |||
| 35 | 35 | ||
| 36 | #if GTK_VERSION < CALC_GTK_VERSION(2,16,0) | 36 | #if GTK_VERSION < CALC_GTK_VERSION(2,16,0) |
| 37 | 37 | ||
| 38 | const gchar *gtk_menu_item_get_label(GtkMenuItem *menu_item); | ||
| 38 | void gtk_menu_item_set_label(GtkMenuItem *menu_item, const gchar *label); | 39 | void gtk_menu_item_set_label(GtkMenuItem *menu_item, const gchar *label); |
| 39 | 40 | ||
| 40 | #endif /* version < 2.16.0 */ | 41 | #endif /* version < 2.16.0 */ |
