Forum > General

no OnCustomDrawItem support for TTreeView?

(1/1)

FangQ:
I tried but it did not work, here is my code:


--- Code: ---// tvFonts is a TTreeView

procedure TForm1.Button1Click(Sender: TObject);
var
   i: integer;
begin
  tvFonts.BeginUpdate;
  for i:=0 to Screen.Fonts.Count-1 do begin
      tvFonts.Items.AddChild(nil,Screen.Fonts.Strings[i]);
  end;
  tvFonts.EndUpdate;
end;

procedure TForm1.tvFontsCustomDrawItem(Sender: TCustomTreeView;
  Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
  Sender.Canvas.Font.Name:=Sender.Caption;
end; 

--- End code ---

typo:
This code works fine on my windows system.

FangQ:

--- Quote from: typo on March 23, 2010, 09:04:33 pm ---This code works fine on my windows system.

--- End quote ---

Unfortunately I was using Ubuntu Linux wit GTK2 backend. Can anyone confirm that this is possible/not possible?

Navigation

[0] Message Index

Go to full version