code snippit relating to my previous question



This program is quite large at this point... here is a piece of a
function: 
----------------------------------------------------------------------------------
    /*** start blanking first 5 cards */
    for(ctr = 0; ctr < 5; ctr ++) {
        gtk_label_set(GTK_LABEL(mother->gui.next_card.program[ctr].label), 
"empty");
    /*** ************** The next line is where gdb reports the crash
     CRASH POINT
     */
        gdk_pixmap = gdk_pixmap_create_from_xpm_d(
            mother->gui.main_window->window, &mask,
            &style->bg[GTK_STATE_NORMAL], cardtype7_xpm);
        gtk_pixmap_set(
            GTK_PIXMAP(mother->gui.next_card.program[ctr].img_hold),
            gdk_pixmap, NULL);
        gdk_pixmap_unref(mother->gui.next_card.program[ctr].image);
        mother->gui.next_card.program[ctr].image = gdk_pixmap;
    }

    /*** change 9 cards to what is available */
    for(ctr = 5; ctr < (howmany + 5); ctr ++) {
        sprintf(tmp, "%d", store[ctr-5]);
        gtk_label_set(GTK_LABEL(mother->gui.next_card.program[ctr].label), 
tmp);
        switch(getType(store[ctr-5])) {
            case 0: gdk_pixmap = gdk_pixmap_create_from_xpm_d(
                        mother->gui.main_window->window, &mask,
                        &style->bg[GTK_STATE_NORMAL], cardtype0_xpm);

		gdk_pixmap_unref(mother->gui.next_card.program[ctr].image);
                    mother->gui.next_card.program[ctr].image = gdk_pixmap;
                    gtk_pixmap_set(

GTK_PIXMAP(mother->gui.next_card.program[ctr].img_hold),
                        gdk_pixmap, NULL);
                    break;
==================================================================================
up to case 6 imagine a window with five pixmaped toggle buttons on top and
9 on the bottom each with a label.... the user clicks 2 buttons and their
cards are swapped... this is where the new cards recieved from the server
are assigned to the form. (sometimes i get to take a turn 3 times,
sometimes it crashes at the first prompt)
----------------------------------------------------------------------------------

Travis Loyd
[email: lelandg@usa.net							]
[other: s201635@mail.nwmissouri.edu					]
[  pgp: send email with subject: sendmepgp				]



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