Beispiel #1
0
void gtk_assert_dialog_set_backtrace_callback(GtkAssertDialog *assertdlg,
                                              GtkAssertDialogStackFrameCallback callback,
                                              void *userdata)
{
    assertdlg->callback = callback;
    assertdlg->userdata = userdata;

    if (gtk_check_version (2, 4, 0))
    {
        // we need to immediately process the stack trace as we're not using
        // an expander since GTK does not support it
        gtk_assert_dialog_process_backtrace (assertdlg);
    }
}
Beispiel #2
0
static void gtk_assert_dialog_expander_callback(GtkWidget*, GtkAssertDialog* dlg)
{
    /* status is not yet updated so we need to invert it to get the new one */
    gboolean expanded = !gtk_expander_get_expanded (GTK_EXPANDER(dlg->expander));
    gtk_window_set_resizable (GTK_WINDOW (dlg), expanded);

    if (dlg->callback == NULL)      /* was the backtrace already processed? */
        return;

    gtk_assert_dialog_process_backtrace (dlg);

    /* mark the work as done (so that next activate we won't call the callback again) */
    dlg->callback = NULL;
}
Beispiel #3
0
void gtk_assert_dialog_expander_callback (GtkWidget *widget, GtkAssertDialog *dlg)
{
    // for some reason we need to invert the return value of gtk_expander_get_expanded
    // to get the real expanded status
    gboolean expanded = !gtk_expander_get_expanded (GTK_EXPANDER(dlg->expander));
    gtk_window_set_resizable (GTK_WINDOW (dlg), expanded);

    if (dlg->callback == NULL)      /* was the backtrace already processed? */
        return;

    gtk_assert_dialog_process_backtrace (dlg);

    /* mark the work as done (so that next activate we won't call the callback again) */
    dlg->callback = NULL;
}