static int error_cnt, warning_cnt, note_cnt;
static GladeXML *message_xml;
-static GtkDialog *message_dialog;
+static GtkWidget *message_dialog;
void
message_dialog_init (struct source_stream *ss)
error_cnt = warning_cnt = note_cnt = 0;
msg_init (ss, enqueue_msg);
message_xml = XML_NEW ("message-dialog.glade");
- message_dialog = GTK_DIALOG (get_widget_assert (message_xml,
- "message-dialog"));
+ message_dialog = get_widget_assert (message_xml, "message-dialog");
}
void
g_queue_free (early_queue);
dropped_messages = 0;
g_queue_free (late_queue);
- gtk_widget_destroy (GTK_WIDGET (message_dialog));
+ gtk_widget_destroy (message_dialog);
g_object_unref (message_xml);
}
}
}
-gboolean
+static gboolean
popup_messages (gpointer unused UNUSED)
{
GtkTextBuffer *text_buffer;
struct string msg = DS_EMPTY_INITIALIZER;
int message_cnt;
+ /* Set up the dialog. */
+ if (message_xml == NULL || message_dialog == NULL)
+ goto use_fallback;
+
/* If a pointer grab is in effect, then the combination of that, and
a modal dialog box, will cause an impossible situation.
So don't pop it up just yet.
*/
- if ( gdk_pointer_is_grabbed ())
- return TRUE;
+ if ( gdk_display_pointer_is_grabbed (gtk_widget_get_display (message_dialog)))
+ {
+ ds_destroy (&lead);
+ ds_destroy (&msg);
+ return TRUE;
+ }
/* Compose the lead-in. */
message_cnt = error_cnt + warning_cnt + note_cnt;
while (!g_queue_is_empty (late_queue))
format_message (g_queue_pop_head (late_queue), &msg);
- /* Set up the dialog. */
- if (message_xml == NULL || message_dialog == NULL)
- goto use_fallback;
-
text_buffer = gtk_text_buffer_new (NULL);
gtk_text_buffer_get_end_iter (text_buffer, &end);
gtk_text_buffer_insert (text_buffer, &end, ds_data (&msg), ds_length (&msg));
goto use_fallback;
gtk_text_view_set_buffer (text_view, text_buffer);
- gtk_dialog_run (message_dialog);
- gtk_widget_hide (GTK_WIDGET (message_dialog));
+ gtk_dialog_run ( GTK_DIALOG (message_dialog));
+ gtk_widget_hide (message_dialog);
ds_destroy (&lead);
ds_destroy (&msg);
void
psppire_data_editor_clip_paste (PsppireDataEditor *de)
{
- GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
+ GdkDisplay *display = gtk_widget_get_display ( GTK_WIDGET (de));
+ GtkClipboard *clipboard =
+ gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD);
gtk_clipboard_request_contents (clipboard,
gdk_atom_intern ("UTF8_STRING", TRUE),
if (++ia->asst.watch_cursor == 1)
{
GtkWidget *widget = GTK_WIDGET (ia->asst.assistant);
- GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
+ GdkDisplay *display = gtk_widget_get_display (widget);
+ GdkCursor *cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
gdk_window_set_cursor (widget->window, cursor);
gdk_cursor_unref (cursor);
- gdk_display_flush (gtk_widget_get_display (widget));
+ gdk_display_flush (display);
}
}