From: Jim Moy Date: 2004-04-27T23:52:58+09:00 Subject: Re: FoX: how to set font for an FXTable item Yuri Leikind wrote: > On Tue, 27 Apr 2004 00:38:24 +0900 > Jim Moy wrote: >> Yuri Leikind wrote: >> > Is there a way to set font for a single FXTableItem ? FXTableItem does not >> > have an appropriate method, there is only a way to set font for the whole >> > FXTable, globally. >> Call FXTableItem.setItem on your subclass of FXTableItem, then twiddle >> to your heart's content in drawContent. > Perhaps you meant calling FXTable.setItem on my subclass of FXTableItem? Yes, my mistake, I mis-typed. > Ok, I define my subclass of FXTableItem with drawContent : > class MyTableItem < Fox::FXTableItem > def drawContent(table, dc, x, y, w, h) > dc.setTextFont(MY_FONT) > dc.foreground = Fox::FXRGB(255, 240, 240) > super(table, dc, x, y, w, h) > But well, that doesn't work. Did I miss something? It looks like super() is overriding your font setting. Here's what I do: def drawContent(table, dc, x, y, w, h) FXDCWindow.new( table ) do |mydc| mydc.textFont = ... mydc.drawText(...) end end Can't remember why the param dc wasn't usable and I had to do the mydc thing, it's been a while since I was in that code... Jim