def rec2gtk(r, formatd=None, rownum=0, autowin=True):
 if (formatd is None):
  formatd = dict()
 formats = []
 for (i, name) in enumerate(r.dtype.names):
  dt = r.dtype[name]
  format = formatd.get(name)
  if (format is None):
   format = mlab.defaultformatd.get(dt.type, mlab.FormatObj())
  format = gtkformat_factory(format, i)
  formatd[name] = format
 colheaders = r.dtype.names
 scroll = SortedStringsScrolledWindow(colheaders, formatd)
 for row in r:
  scroll.add_row(row)
 if autowin:
  win = gtk.Window()
  win.set_default_size(800, 600)
  win.add(scroll)
  win.show_all()
  scroll.win = win
 return scroll

def rec2gtk ( r , formatd = None , rownum = 0 , autowin = True ) : if ( formatd is None ) : formatd = dict ( ) formats = [ ] for ( i , name ) in enumerate ( r . dtype . names ) : dt = r . dtype [ name ] format = formatd . get ( name ) if ( format is None ) : format = mlab . defaultformatd . get ( dt . type , mlab . FormatObj ( ) ) format = gtkformat_factory ( format , i ) formatd [ name ] = format colheaders = r . dtype . names scroll = SortedStringsScrolledWindow ( colheaders , formatd ) for row in r : scroll . add_row ( row ) if autowin : win = gtk . Window ( ) win . set_default_size ( 800 , 600 ) win . add ( scroll ) win . show_all ( ) scroll . win = win return scroll
formatd is a dictionary mapping dtype name -> mlab .