-------- Original Message -------- Subject: [Jprogramming] Setting colors of listbox items Date: Sun, 05 Mar 2006 21:15:33 +0300 From: Mikl Kurkov <[EMAIL PROTECTED]> Reply-To: Programming forum <[email protected]> To: [email protected]
Is it possible to set different background colors for listbox items? I wish to highlight some items based on boolean vector. Or maybe it better to use grid for such a thing? ---------------------- There is no way to color listbox items arbitrarily. You can use the grid for this, and it is best to use the new grid in J6. For example: require 'jsgrid' require '~system\examples\data\datename.ijs' CELLCOLORS=: 255 * 0 0 0 ,"1 (=i.3) ,"1 [ 3 # 1 0 CELLCOLOR=: ,.12 $ i.3 CELLDATA=: ,.MONTHS CELLALIGN=: 0 GRIDLINES=: 0 GRIDNAMES=: 'cellalign cellcolor cellcolors celldata gridlines' TEST=: 0 : 0 pc test; xywh 103 8 48 12;cc ok button;cn "OK"; xywh 103 24 48 12;cc cancel button;cn "Cancel"; xywh 15 7 72 108;cc grid isigraph; pas 6 6;pcenter; rem form end; ) test_run=: 3 : 0 wd TEST grid=: conew 'jsgrid' show__grid GRIDNAMES wd 'pshow;' ) test_cancel_button=: test_close=: wd bind 'pclose' select_result=: 3 : 0 wdinfo y pick MONTHS ) test_run'' ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
