3 #include "../../util/util.h" 4 #include "../../util/debug.h" 16 ctx =
malloc(
sizeof(*pgctx));
38 vasprintf(&msg, format, args) < 0) {
39 fprintf(stderr,
"Error:\n");
40 vfprintf(stderr, format, args);
41 fprintf(stderr,
"\n");
45 dialog = gtk_message_dialog_new_with_markup(GTK_WINDOW(pgctx->
main_window),
46 GTK_DIALOG_DESTROY_WITH_PARENT,
49 "<b>Error</b>\n\n%s", msg);
50 gtk_dialog_run(GTK_DIALOG(dialog));
52 gtk_widget_destroy(dialog);
57 #ifdef HAVE_GTK_INFO_BAR_SUPPORT 58 static int perf_gtk__warning_info_bar(
const char *format, va_list
args)
63 vasprintf(&msg, format, args) < 0) {
64 fprintf(stderr,
"Warning:\n");
65 vfprintf(stderr, format, args);
66 fprintf(stderr,
"\n");
70 gtk_label_set_text(GTK_LABEL(pgctx->message_label), msg);
71 gtk_info_bar_set_message_type(GTK_INFO_BAR(pgctx->info_bar),
73 gtk_widget_show(pgctx->info_bar);
84 vasprintf(&msg, format, args) < 0) {
85 fprintf(stderr,
"Warning:\n");
86 vfprintf(stderr, format, args);
87 fprintf(stderr,
"\n");
91 gtk_statusbar_pop(GTK_STATUSBAR(pgctx->
statbar),
95 p = strchr(msg,
'\n');
99 gtk_statusbar_push(GTK_STATUSBAR(pgctx->
statbar),
109 #ifdef HAVE_GTK_INFO_BAR_SUPPORT 110 .warning = perf_gtk__warning_info_bar,
struct perf_gtk_context * pgctx
struct perf_gtk_context * perf_gtk__activate_context(GtkWidget *window)
static int perf_gtk__warning_statusbar(const char *format, va_list args)
int(* error)(const char *format, va_list args)
struct perf_error_ops perf_gtk_eops
static bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
static int perf_gtk__error(const char *format, va_list args)
static GtkWidget * dialog
int perf_gtk__deactivate_context(struct perf_gtk_context **ctx)