1.0.6 -> 1.2.1 problems...



Hi,

I'm trying to migrate my program, which works fine under 1.0.6, to
1.2.1. Most changes were very minor and went smoothly, but I'm having a
couple of problems I can't quite figure out...

(Running RedHat Linux 5.2 + kernel 2.2.3, Fvwm 1.24r. Gtk/Glib compiled
locally, not using RPMs.)

* File selection dialogs, created with

    fileSelectW = gtk_file_selection_new( title );

and later modified with

    gtk_window_set_title( GTK_WINDOW(fileSelectW), title );

where title is a gchar *, come up with all the right widgets, but the
window title is a jumble of random ASCII and other characters. Dialogs
created with gtk_dialog_new, OTOH, have the correct title.

* This one is hard to describe, so please bear with me :). There's a
(square) button that displays one of two pixmaps to indicate a control
being on or off. When the user clicks the button, the pixmap being
displayed alternates by removing the current one and replacing it with
the other:

    if( strcmp( enable, "ON" ) == SUCCESS ) {
        // currently off, turn it on
        xpmFile = "./sma_on.xpm";
    }
    else {
        // currently on, turn it off
        xpmFile = "./sma_off.xpm";
    }
    pixmap = gdk_pixmap_create_from_xpm( GDK_ROOT_PARENT(), &mask,
                                         &style->bg[GTK_STATE_NORMAL],
                                         xpmFile );
    pixmapW = gtk_pixmap_new( pixmap, mask );

    // remove the pixmap that's there now...
    gtk_container_remove( GTK_CONTAINER(ptr->button), ptr->statusPixmap );

    // ...and replace it with the one reflecting the up-to-date state
    gtk_container_add( GTK_CONTAINER(ptr->button), pixmapW );

    gtk_widget_show( pixmapW );

    // remember it so we can remove it next time through here
    ptr->statusPixmap = pixmapW;

    gdk_pixmap_unref( pixmap );

where ptr is a pointer to a structure that holds various widgets and
other info. The first time the user clicks, the pixmap is drawn so that
the upper-left quadrant of the button shows the lower-right quadrant of
the pixmap, but then it clears up on a redraw (eg, if the pointer simply
moves off the button then back on) and all is correct. I know this isn't
the clearest description, but it's hard to put in words - I'd be happy
to provide a screenshot if it would help. Has anyone seen anything
resembling this before?

I checked the archives but didn't see anything that looked relevant...

All help appreciated!

Thanks,

-- 
Toby Schaffer       "Don't kid yourself, Jimmy. If a cow ever got the
Grad-type Person    chance, he'd eat you and everyone you care about!"
ECE Dept., NCSU                                                 -- TM
PGP fingerprint: 56 DA 2C 14 C7 02 36 3E  C0 EB 9E 1E 95 6B 0C E5



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