Can´t include fonts in a ComboBox lazarus / 13-General ---------------------------------------------------------------------- Anonymous · 2005-11-21 22:27 As a practice, I'm folowing the example of a book on Delphi 4, whit this code: Code: [Select]procedure TFormStandard.FormCreate(Sender: TObject);   begin        ComboBox1.Items := Screen.Fonts;   end; says that all the fonts of the system should be displayed in a ComboBox, but nothing happens. (the project compiles fine). The object Screen must be created or declared? Or it's done automatically? If so, when? or where? God exists? Is there life before death? Sorry... to much questions. :-) Thanks Galbi. ---------------------------------------------------------------------- Legolas · 2005-11-21 22:29 AFAIK Screen object is still unimplemented Edit: this anomaly seems resovled. Look here I have tryed Code: [Select] combobox.items.assign(screen.fonts); and Code: [Select] combobox.items := screen.fonts; whit Lazarus 0.9.11 and it works fine. ---------------------------------------------------------------------- Anonymous · 2005-11-23 22:29 Sorry but seens not to work, to wich event it should be assigned? This is what I've done: Code: [Select]unit Unit1; {$mode objfpc}{$H+} interface uses   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls; type   { TForm1 }   TForm1 = class(TForm)     ComboBox1: TComboBox;     Memo1: TMemo;     procedure FormCreate(Sender: TObject);   private     { private declarations }   public     { public declarations }   end; var   Form1: TForm1; implementation { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin   combobox1.items.assign(screen.fonts);   combobox1.items := screen.fonts; end; initialization   {$I unit1.lrs} end. What's wrong? Galbi. ---------------------------------------------------------------------- Legolas · 2005-11-24 00:55 Quote from: "Anonymous" What's wrong? This: Quote procedure TForm1.FormCreate(Sender: TObject); begin   // You should use either combobox1.items.assign(screen.fonts)   // or combobox1.items := screen.fonts   combobox1.items.assign(screen.fonts); end; But it should work even as you have written. Check your lazarus version number. AFAIK you should have at least 0.9.11. ---------------------------------------------------------------------- Anonymous · 2005-11-24 19:30 Sorry for my insistence, but I might be doing something wrong or perhaps there is a package/library I haven't got installed, and that's why it doesn't work. I'm using win32 and Laz 0.9.11 Thanks for your time. Galbi. ---------------------------------------------------------------------- Legolas · 2005-11-24 21:04 Quote from: "Anonymous"Sorry for my insistence, but I might be doing something wrong or perhaps there is a package/library I haven't got installed, and that's why it doesn't work. I'm using win32 and Laz 0.9.11 Thanks for your time. Galbi. I'm using win32 and lazarus 0.9.11 too and your source code compiles and runs fine. Just try to reinstall lazarus from scratch... otherwise I don't know where is the problem ---------------------------------------------------------------------- Anonymous · 2005-11-25 21:17 I've downloaded and installed today's snapshot and the problem it´s solved.:-) :-) Thanks.