~ubuntu-branches/ubuntu/vivid/nip2/vivid-proposed

« back to all changes in this revision

Viewing changes to src/matrixview.c

  • Committer: Bazaar Package Importer
  • Author(s): Jay Berkenbilt
  • Date: 2010-12-27 14:53:08 UTC
  • mfrom: (2.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20101227145308-vampjbuuft281j3l
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
455
455
        GType *types;
456
456
        int i, y;
457
457
        GtkListStore *store;
458
 
        int *columns;
459
 
        GValue *values;
460
458
 
461
459
        types = g_new( GType, width );
462
460
        for( i = 0; i < width; i++ )
464
462
        store = gtk_list_store_newv( width, types );
465
463
        g_free( types );
466
464
 
467
 
        columns = g_new( int, width );
468
 
        values = g_new0( GValue, width );
469
 
 
470
 
        for( i = 0; i < width; i++ ) {
471
 
                columns[i] = i;
472
 
                g_value_init( &values[i], G_TYPE_DOUBLE );
473
 
        }
474
 
 
475
465
        for( y = 0; y < height; y++ ) {
476
466
                GtkTreeIter iter;
477
467
 
 
468
                gtk_list_store_append( store, &iter );
 
469
 
478
470
                for( i = 0; i < width; i++ ) 
479
 
                        g_value_set_double( &values[i], 
480
 
                                matrixvalue->coeff[y * width + i] );
481
 
 
482
 
                gtk_list_store_append( store, &iter );
483
 
                gtk_list_store_set_valuesv( store, &iter, 
484
 
                        columns, values, width );
 
471
                        gtk_list_store_set( store, &iter, 
 
472
                                i, matrixvalue->coeff[y * width + i], -1 );
485
473
        }
486
474
 
487
 
        for( i = 0; i < width; i++ ) 
488
 
                g_value_unset( &values[i] );
489
 
 
490
 
        g_free( values );
491
 
        g_free( columns );
492
 
 
493
475
        return( store );
494
476
}
495
477