pixmap spacing problem



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

First, I want to thank everyone who has answered my earlier
questions. This is all starting to make sense.

I do, however, have another question. I have created a window
which is intended to contain a pixmap (logo) at the top and then,
after some space, some other widgets. I create the pixmap from an
xpm file and display it, but I can't seem to figure out how to add
the space before the label widget.

- --------
    GtkWidget *logo_widget;
    GdkColor color;
    GtkRcStyle *rc_style;
    GdkPixmap *logo, *logo_mask;
    char *logofile = "sbcs.xpm";
    GdkFont *font, *bold_font;
    GtkStyle *style;

    /* parse a color string */
    gdk_color_parse("#5a00c6", &color);

    /* --- Create the top window and size it. --- */
    win_main = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size (GTK_WINDOW (win_main), 700, 500);

    /* --- Let the window be resized. --- */
    gtk_window_set_policy (GTK_WINDOW (win_main), TRUE, TRUE, TRUE);

    /* --- Title --- */
    gtk_window_set_title (GTK_WINDOW (win_main), "My Window");
    gtk_container_set_border_width (GTK_CONTAINER (win_main), 5);

    /* Create a GtkRcStyle and assign blue to the background */
    rc_style = gtk_rc_style_new();
    rc_style->bg[GTK_STATE_NORMAL] = color;

    /* assign which widget color is to be affected */
    rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_BG;

    /* --- Top level window should listen for the destroy --- */
    gtk_signal_connect (GTK_OBJECT (win_main), "destroy",
              GTK_SIGNAL_FUNC(ExitProgram), NULL);

    /* --- Create v-box-main for win_main --- */
    vbox_main = gtk_vbox_new (TRUE, 0);

    /* --- Put up v-box --- */
    gtk_container_add (GTK_CONTAINER (win_main), vbox_main);

    /* --- Create v-box for menu */
    menu_vbox = gtk_vbox_new (FALSE, 0);

    /* --- Put up main v-box --- */
    gtk_box_pack_start (GTK_BOX (vbox_main), menu_vbox, FALSE, TRUE, 0);

    menubar=AddMenu();
    gtk_box_pack_start (GTK_BOX (menu_vbox), menubar, FALSE, TRUE, 0);

    /* Create logo from pixmap to add to vbox2 */
    logo = gdk_pixmap_colormap_create_from_xpm(NULL,
		gtk_widget_get_colormap(win_main),
		&logo_mask,NULL,logofile);
    logo_widget = gtk_pixmap_new(logo, logo_mask);
    gdk_pixmap_unref(logo);
    gdk_pixmap_unref(logo_mask);
    gtk_widget_show(logo_widget);
    gtk_box_pack_start(GTK_BOX(vbox_main),logo_widget,TRUE,TRUE,10);

    /* --- Create v-box for text and widgets --- */
    vbox2 = gtk_vbox_new (TRUE, 5);
    /* --- Put up v-box --- */
    gtk_box_pack_start (GTK_BOX (vbox_main), vbox2, FALSE, TRUE, 0);
- -------

The logo pixmap appears, but there is no space between it and the first
widget in vbox2. I've tried a lot of things - including adding a separator.
Nothing works. I've tried changing the box_pack_start values. I would really
appreciate some help. Additionally, since this is my first real GTK effort,
any comments about standard GTK stuff that I have violated are fair game.

Have a good day!
- -Vicki
+-----------------------------------------------------------------+
|              E-mail:  vicki thepenguin org                      |
|    My public key - http://www.thepenguin.org/vicki/key.txt      |
|         My Linux page - http://www.thepenguin.org               |
+-----------------------------------------------------------------+
**The best things in life aren't things.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7CWD/vFwCsl/kaSARAmfPAKCm0sYtR9PQaUfbRPE+rhcDr72QPQCgtzZD
NfDLWO/d0QR27Uwy9UHsbmM=
=lJ8G
-----END PGP SIGNATURE-----





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