With GTK1 interface is impossible give focus to another form
Original Reporter info from Mantis: fello
-
Reporter name: Fabrizio Fellini
Original Reporter info from Mantis: fello
- Reporter name: Fabrizio Fellini
Description:
Sorry for my bad English...
I have 2 forms, one with an EditBox, the other with a Button.
When I click the Button, I want to give the focus to the EditBox on the other form: with Win32 interface that is all OK, but with Linux-GTK1 interface the focus remain on the Button and it doesn't go to the EditBox.
What is wrong in the GTK1 interface?
Additional information:
First Form code:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormShow(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
uses unit2;
procedure TForm1.FormShow(Sender: TObject);
begin
Form2.Show;
end;
initialization
{$I unit1.lrs}
end.
Second Form code:
unit Unit2;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
LMessages;
type
{ TForm2 }
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form2: TForm2;
implementation
{ TForm2 }
uses unit1;
procedure TForm2.Button1Click(Sender: TObject);
begin
Form1.Edit1.SetFocus;
end;
initialization
{$I unit2.lrs}
end.