Compare commits
5 Commits
linear-com
...
message-wi
Author | SHA1 | Date | |
---|---|---|---|
|
2cf360cd65 | ||
|
68fa64d61e | ||
|
54ca75b529 | ||
|
d930998f2a | ||
|
ae3f7d3032 |
@@ -18,19 +18,23 @@ static void
|
||||
message_dialog_clicked (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
static int i = 1;
|
||||
GtkAlertDialog *dialog;
|
||||
GtkWindow *parent;
|
||||
static int count = 1;
|
||||
char *detail;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_OK_CANCEL,
|
||||
"Test message");
|
||||
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
||||
ngettext ("Has been shown once", "Has been shown %d times", i), i);
|
||||
g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
|
||||
gtk_widget_show (dialog);
|
||||
i++;
|
||||
parent = GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (button), GTK_TYPE_WINDOW));
|
||||
|
||||
dialog = gtk_alert_dialog_new ("Test message");
|
||||
detail = g_strdup_printf (ngettext ("Has been shown once", "Has been shown %d times", count), count);
|
||||
gtk_alert_dialog_set_detail (dialog, detail);
|
||||
g_free (detail);
|
||||
gtk_alert_dialog_set_buttons (dialog, (const char *[]) {"_Cancel", "_OK", NULL });
|
||||
gtk_alert_dialog_set_cancel_button (dialog, 0);
|
||||
gtk_alert_dialog_set_default_button (dialog, 1);
|
||||
|
||||
gtk_alert_dialog_show (dialog, parent);
|
||||
count++;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
@@ -1,11 +1,8 @@
|
||||
/* Pickers
|
||||
* #Keywords: GtkColorDialog, GtkFontDialog, GtkFileDialog
|
||||
* #Keywords: GtkColorDialog, GtkFontDialog, GtkFileDialog, GtkColorDialogButton, GtkFontDialogButton, chooser, button
|
||||
*
|
||||
* These widgets are mainly intended for use in preference dialogs.
|
||||
* They allow to select colors, fonts and applications.
|
||||
*
|
||||
* This demo shows both the default appearance for these dialogs,
|
||||
* as well as some of the customizations that are possible.
|
||||
* These widgets and async APIs are mainly intended for use in preference dialogs.
|
||||
* They allow to select colors, fonts, files and applications.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
@@ -16,21 +13,16 @@ file_opened (GObject *source,
|
||||
void *data)
|
||||
{
|
||||
GFile *file;
|
||||
GError *error = NULL;
|
||||
char *name;
|
||||
|
||||
file = gtk_file_dialog_open_finish (GTK_FILE_DIALOG (source), result, &error);
|
||||
file = gtk_file_dialog_open_finish (GTK_FILE_DIALOG (source), result, NULL);
|
||||
|
||||
if (!file)
|
||||
if (file)
|
||||
{
|
||||
g_print ("%s\n", error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
|
||||
name = g_file_get_basename (file);
|
||||
gtk_button_set_label (GTK_BUTTON (data), name);
|
||||
g_free (name);
|
||||
char *name = g_file_get_basename (file);
|
||||
gtk_button_set_label (GTK_BUTTON (data), name);
|
||||
g_object_set_data_full (G_OBJECT (data), "file", file, g_object_unref);
|
||||
g_free (name);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -38,10 +30,13 @@ open_file (GtkButton *picker)
|
||||
{
|
||||
GtkWindow *parent = GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (picker)));
|
||||
GtkFileDialog *dialog;
|
||||
GFile *file;
|
||||
|
||||
dialog = gtk_file_dialog_new ();
|
||||
|
||||
gtk_file_dialog_open (dialog, parent, NULL, NULL, file_opened, picker);
|
||||
file = (GFile *) g_object_get_data (G_OBJECT (picker), "file");
|
||||
|
||||
gtk_file_dialog_open (dialog, parent, file, NULL, file_opened, picker);
|
||||
|
||||
g_object_unref (dialog);
|
||||
}
|
||||
@@ -95,7 +90,7 @@ do_pickers (GtkWidget *do_widget)
|
||||
gtk_widget_set_hexpand (label, TRUE);
|
||||
gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
|
||||
|
||||
picker = gtk_button_new_with_label ("[...]");
|
||||
picker = gtk_button_new_with_label ("None");
|
||||
g_signal_connect (picker, "clicked", G_CALLBACK (open_file), NULL);
|
||||
gtk_grid_attach (GTK_GRID (table), picker, 1, 2, 1, 1);
|
||||
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#include "gtkalertdialog.h"
|
||||
|
||||
#include "gtkbutton.h"
|
||||
#include "deprecated/gtkmessagedialog.h"
|
||||
#include "gtkmessagewindowprivate.h"
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
/**
|
||||
@@ -592,7 +592,7 @@ static void
|
||||
cancelled_cb (GCancellable *cancellable,
|
||||
GTask *task)
|
||||
{
|
||||
response_cb (task, GTK_RESPONSE_CLOSE);
|
||||
response_cb (task, -1);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -600,6 +600,7 @@ response_cb (GTask *task,
|
||||
int response)
|
||||
{
|
||||
GCancellable *cancellable;
|
||||
GtkWindow *window;
|
||||
|
||||
cancellable = g_task_get_cancellable (task);
|
||||
|
||||
@@ -613,7 +614,6 @@ response_cb (GTask *task,
|
||||
else
|
||||
{
|
||||
GtkAlertDialog *self = GTK_ALERT_DIALOG (g_task_get_source_object (task));
|
||||
|
||||
g_task_return_int (task, self->cancel_return);
|
||||
}
|
||||
|
||||
@@ -621,47 +621,55 @@ response_cb (GTask *task,
|
||||
}
|
||||
|
||||
static void
|
||||
dialog_response (GtkDialog *dialog,
|
||||
int response,
|
||||
button_response (GtkButton *button,
|
||||
GTask *task)
|
||||
{
|
||||
int response = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "response"));
|
||||
|
||||
response_cb (task, response);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_message_dialog (GtkAlertDialog *self,
|
||||
GtkWindow *parent)
|
||||
static GtkMessageWindow *
|
||||
create_message_window (GtkAlertDialog *self,
|
||||
GtkWindow *parent,
|
||||
GTask *task)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkMessageWindow *window;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
window = g_object_new (GTK_TYPE_MESSAGE_DIALOG,
|
||||
"transient-for", parent,
|
||||
"destroy-with-parent", TRUE,
|
||||
"modal", self->modal,
|
||||
"text", self->message,
|
||||
"secondary-text", self->detail,
|
||||
NULL);
|
||||
window = gtk_message_window_new ();
|
||||
if (parent)
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), parent);
|
||||
gtk_window_set_modal (GTK_WINDOW (window), TRUE);
|
||||
gtk_message_window_set_message (window, self->message);
|
||||
gtk_message_window_set_detail (window, self->detail);
|
||||
|
||||
if (self->buttons && self->buttons[0])
|
||||
{
|
||||
self->cancel_return = -1;
|
||||
for (int i = 0; self->buttons[i]; i++)
|
||||
{
|
||||
gtk_dialog_add_button (GTK_DIALOG (window), self->buttons[i], i);
|
||||
GtkWidget *button;
|
||||
|
||||
button = gtk_button_new_with_mnemonic (self->buttons[i]);
|
||||
g_object_set_data (G_OBJECT (button), "response", GINT_TO_POINTER (i));
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (button_response), task);
|
||||
gtk_message_window_add_button (window, button);
|
||||
if (self->default_button == i)
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (window), i);
|
||||
gtk_window_set_default_widget (GTK_WINDOW (window), button);
|
||||
if (self->cancel_button == i)
|
||||
self->cancel_return = i;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_dialog_add_button (GTK_DIALOG (window), _("_Close"), 0);
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (window), 0);
|
||||
GtkWidget *button;
|
||||
|
||||
button = gtk_button_new_with_mnemonic (_("_Close"));
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (button_response), task);
|
||||
gtk_message_window_add_button (window, button);
|
||||
gtk_window_set_default_widget (GTK_WINDOW (window), button);
|
||||
self->cancel_return = 0;
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -701,16 +709,15 @@ gtk_alert_dialog_choose (GtkAlertDialog *self,
|
||||
|
||||
g_return_if_fail (GTK_IS_ALERT_DIALOG (self));
|
||||
|
||||
window = create_message_dialog (self, parent);
|
||||
|
||||
task = g_task_new (self, cancellable, callback, user_data);
|
||||
g_task_set_source_tag (task, gtk_alert_dialog_choose);
|
||||
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
||||
|
||||
if (cancellable)
|
||||
g_signal_connect (cancellable, "cancelled", G_CALLBACK (cancelled_cb), task);
|
||||
|
||||
g_signal_connect (window, "response", G_CALLBACK (dialog_response), task);
|
||||
window = GTK_WIDGET (create_message_window (self, parent, task));
|
||||
|
||||
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
}
|
||||
|
147
gtk/gtkmessagewindow.c
Normal file
147
gtk/gtkmessagewindow.c
Normal file
@@ -0,0 +1,147 @@
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 2 -*- */
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2000 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-2003. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkmessagewindowprivate.h"
|
||||
|
||||
#include "gtkbox.h"
|
||||
#include "gtkbuildable.h"
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include "gtklabel.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtktypebuiltins.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
struct _GtkMessageWindow
|
||||
{
|
||||
GtkWindow parent;
|
||||
|
||||
GtkBox *message_area;
|
||||
GtkLabel *message;
|
||||
GtkLabel *detail;
|
||||
GtkBox *buttons;
|
||||
};
|
||||
|
||||
struct _GtkMessageWindowClass
|
||||
{
|
||||
GtkWindowClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GtkMessageWindow, gtk_message_window, GTK_TYPE_WINDOW)
|
||||
|
||||
static void
|
||||
gtk_message_window_init (GtkMessageWindow *self)
|
||||
{
|
||||
GtkSettings *settings;
|
||||
gboolean use_caret;
|
||||
|
||||
gtk_widget_add_css_class (GTK_WIDGET (self), "message");
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
|
||||
settings = gtk_widget_get_settings (GTK_WIDGET (self));
|
||||
g_object_get (settings, "gtk-keynav-use-caret", &use_caret, NULL);
|
||||
gtk_label_set_selectable (self->message, use_caret);
|
||||
gtk_label_set_selectable (self->detail, use_caret);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_message_window_class_init (GtkMessageWindowClass *class)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/ui/gtkmessagewindow.ui");
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkMessageWindow, message_area);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkMessageWindow, message);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkMessageWindow, detail);
|
||||
gtk_widget_class_bind_template_child (widget_class, GtkMessageWindow, buttons);
|
||||
|
||||
gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Escape, 0, "window.close", NULL);
|
||||
|
||||
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_DIALOG);
|
||||
}
|
||||
|
||||
GtkMessageWindow *
|
||||
gtk_message_window_new (void)
|
||||
{
|
||||
return g_object_new (GTK_TYPE_MESSAGE_WINDOW, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_message_window_set_message (GtkMessageWindow *self,
|
||||
const char *message)
|
||||
{
|
||||
gtk_label_set_text (self->message, message);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_message_window_set_detail (GtkMessageWindow *self,
|
||||
const char *detail)
|
||||
{
|
||||
gtk_label_set_text (self->detail, detail);
|
||||
if (detail != NULL)
|
||||
{
|
||||
gtk_widget_show (GTK_WIDGET (self->detail));
|
||||
gtk_widget_add_css_class (GTK_WIDGET (self->message), "title");
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_hide (GTK_WIDGET (self->detail));
|
||||
gtk_widget_remove_css_class (GTK_WIDGET (self->message), "title");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_message_window_add_button (GtkMessageWindow *self,
|
||||
GtkWidget *button)
|
||||
{
|
||||
gtk_box_append (self->buttons, button);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void
|
||||
gtk_message_window_set_default_button (GtkMessageWindow *self,
|
||||
GtkButton *button)
|
||||
{
|
||||
gtk_window_set_default_widget (GTK_WINDOW (self), GTK_WIDGET (button));
|
||||
}
|
||||
|
||||
void
|
||||
gtk_message_window_set_cancel_button (GtkMessageWindow *self,
|
||||
GtkButton *button)
|
||||
{
|
||||
/* FIXME */
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
gtk_message_window_add_extra_widget (GtkMessageWindow *self,
|
||||
GtkWidget *extra)
|
||||
{
|
||||
gtk_box_append (self->message_area, extra);
|
||||
}
|
||||
|
50
gtk/gtkmessagewindowprivate.h
Normal file
50
gtk/gtkmessagewindowprivate.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2000 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-2003. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtkwindow.h>
|
||||
#include <gtk/gtkbutton.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_MESSAGE_WINDOW (gtk_message_window_get_type ())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (GtkMessageWindow, gtk_message_window, GTK, MESSAGE_WINDOW, GtkWindow)
|
||||
|
||||
GtkMessageWindow * gtk_message_window_new (void);
|
||||
|
||||
void gtk_message_window_set_message (GtkMessageWindow *self,
|
||||
const char *message);
|
||||
|
||||
void gtk_message_window_set_detail (GtkMessageWindow *self,
|
||||
const char *detail);
|
||||
|
||||
void gtk_message_window_add_button (GtkMessageWindow *self,
|
||||
GtkWidget *button);
|
||||
|
||||
void gtk_message_window_add_extra_widget (GtkMessageWindow *self,
|
||||
GtkWidget *extra);
|
||||
|
||||
G_END_DECLS
|
@@ -47,7 +47,7 @@
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include "gtkmain.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "deprecated/gtkmessagedialog.h"
|
||||
#include "gtkmessagewindowprivate.h"
|
||||
#include "gtkpointerfocusprivate.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkroot.h"
|
||||
@@ -6079,24 +6079,27 @@ static void gtk_window_set_debugging (GdkDisplay *display,
|
||||
gboolean warn);
|
||||
|
||||
static void
|
||||
warn_response (GtkDialog *dialog,
|
||||
int response)
|
||||
warn_response (GtkWidget *button,
|
||||
GtkWindow *dialog)
|
||||
{
|
||||
GtkWidget *inspector_window;
|
||||
GtkWidget *check;
|
||||
gboolean remember;
|
||||
GtkWidget *inspector_window;
|
||||
GdkDisplay *display;
|
||||
int response;
|
||||
|
||||
inspector_window = GTK_WIDGET (gtk_window_get_transient_for (GTK_WINDOW (dialog)));
|
||||
response = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "response"));
|
||||
|
||||
inspector_window = GTK_WIDGET (gtk_window_get_transient_for (dialog));
|
||||
display = gtk_inspector_window_get_inspected_display (GTK_INSPECTOR_WINDOW (inspector_window));
|
||||
|
||||
check = g_object_get_data (G_OBJECT (dialog), "check");
|
||||
remember = gtk_check_button_get_active (GTK_CHECK_BUTTON (check));
|
||||
|
||||
gtk_window_destroy (GTK_WINDOW (dialog));
|
||||
gtk_window_destroy (dialog);
|
||||
g_object_set_data (G_OBJECT (inspector_window), "warning_dialog", NULL);
|
||||
|
||||
if (response == GTK_RESPONSE_NO)
|
||||
if (response == 0)
|
||||
gtk_window_set_debugging (display, FALSE, FALSE, FALSE, FALSE);
|
||||
else
|
||||
set_warn_again (!remember);
|
||||
@@ -6110,8 +6113,8 @@ gtk_window_set_debugging (GdkDisplay *display,
|
||||
gboolean warn)
|
||||
{
|
||||
GtkWidget *dialog = NULL;
|
||||
GtkWidget *area;
|
||||
GtkWidget *check;
|
||||
GtkWidget *button;
|
||||
GtkWidget *inspector_window;
|
||||
gboolean was_debugging;
|
||||
|
||||
@@ -6130,30 +6133,31 @@ gtk_window_set_debugging (GdkDisplay *display,
|
||||
|
||||
if (warn)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (inspector_window),
|
||||
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_QUESTION,
|
||||
GTK_BUTTONS_NONE,
|
||||
_("Do you want to use GTK Inspector?"));
|
||||
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
||||
dialog = GTK_WIDGET (gtk_message_window_new ());
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (inspector_window));
|
||||
gtk_message_window_set_detail (GTK_MESSAGE_WINDOW (dialog),
|
||||
_("GTK Inspector is an interactive debugger that lets you explore and "
|
||||
"modify the internals of any GTK application. Using it may cause the "
|
||||
"application to break or crash."));
|
||||
|
||||
area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog));
|
||||
check = gtk_check_button_new_with_label (_("Don’t show this message again"));
|
||||
gtk_widget_set_margin_start (check, 10);
|
||||
gtk_widget_show (check);
|
||||
gtk_box_append (GTK_BOX (area), check);
|
||||
gtk_message_window_add_extra_widget (GTK_MESSAGE_WINDOW (dialog), check);
|
||||
g_object_set_data (G_OBJECT (dialog), "check", check);
|
||||
gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), GTK_RESPONSE_NO);
|
||||
gtk_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), GTK_RESPONSE_YES);
|
||||
g_signal_connect (dialog, "response", G_CALLBACK (warn_response), inspector_window);
|
||||
|
||||
button = gtk_button_new_with_mnemonic (_("_Cancel"));
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (warn_response), dialog);
|
||||
gtk_message_window_add_button (GTK_MESSAGE_WINDOW (dialog), button);
|
||||
|
||||
button = gtk_button_new_with_mnemonic (_("_OK"));
|
||||
g_object_set_data (G_OBJECT (button), "response", GINT_TO_POINTER (1));
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (warn_response), dialog);
|
||||
gtk_message_window_add_button (GTK_MESSAGE_WINDOW (dialog), button);
|
||||
|
||||
g_object_set_data (G_OBJECT (inspector_window), "warning_dialog", dialog);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
|
||||
if (select)
|
||||
|
@@ -120,6 +120,7 @@ gtk_private_sources = files([
|
||||
'gtkmenusectionbox.c',
|
||||
'gtkmenutracker.c',
|
||||
'gtkmenutrackeritem.c',
|
||||
'gtkmessagewindow.c',
|
||||
'gtkpanedhandle.c',
|
||||
'gtkpango.c',
|
||||
'gskpango.c',
|
||||
|
Reference in New Issue
Block a user