Re: CVS commit 1.189 (Owen) and gtk_window_set_has_frame



Not really, try this code (on X11) and uncomment
gtk_window_set_frame_dimensions after.

/* gcc -g `pkg-config --libs --cflags gtk+-2.0`    simple-color-
dialog.c  -o simple-color-dialog */

#include <gtk/gtk.h>

int main (int argc, char **argv)
{
        GtkWidget *window;
        GtkWidget *dialog;
        int ret;
        GdkColor couleur = {0, 0xFF00, 0xD700, 0x2500};

        gtk_init (&argc, &argv);

        dialog = gtk_message_dialog_new(
                NULL,
                GTK_DIALOG_MODAL,
                GTK_MESSAGE_QUESTION,
                GTK_BUTTONS_CANCEL,
                "My question ?");
        gtk_window_set_has_frame(GTK_WINDOW(dialog), TRUE);
        gtk_window_set_frame_dimensions(GTK_WINDOW(dialog),
                                        6, 6, 6, 6);
        gtk_widget_show_all(dialog);

        /* Frame Color */
        gdk_rgb_find_color(gtk_widget_get_colormap(dialog), &couleur);
        gdk_window_set_background(GTK_WINDOW(dialog)->frame,
                                  &couleur);

        ret = gtk_dialog_run(GTK_DIALOG(dialog));
        gtk_widget_destroy(dialog);

        return 0;
}


> gtk_window_set_has_frame is called for you when gtk is built with the
> framebuffer backend, so there is no need to call it explicitly. Simply
> remove the call. (The call to gtk_window_set_frame_dimensions is fine,
> it'll simply be a noop on X11).
> 
> -Yosh




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]