The environment- Lazarus 1.8.4 (GTK2) / FPC 3.0.4
- Kubuntu 14.04 / Ubuntu 10.10
The programIt's a very simple program: just a form with a TMainMenu, a TMemo, some actions and little else. In the main menu there is---among others---a top-level item "Edit" with a submenu of items "Undo, "Cut", "Copy", "Paste", etc.
The handlers for items "Edit" and "Undo" are these:
procedure TMain.itEditClick(Sender: TObject);
begin
itEditUndo.Enabled := Memo.CanUndo;
{itEditRedo.Enabled := False;}{ No redo for the wicked!? }
itEditCut.Enabled := (Memo.SelLength > 0) and (not Memo.ReadOnly);
itEditCopy.Enabled := (Memo.SelLength > 0);
itEditPaste.Enabled := (not Memo.ReadOnly) and
Clipboard.HasFormat(CF_Text);
{... etc. sniped for the forum ...}
end;
procedure TMain.itEditUndoClick(Sender: TObject);
begin
Memo.Undo;
end;
The problemWhatever I do: type, paste, delete, etc.
Memo.CanUndo is always false.
Even if I comment out the line:
itEditUndo.Enabled := Memo.CanUndo;and keep the item
itEditUndo always enabled,
Memo.Undo, of course, does nothing.
The question(s)Is this some bug (in GTK, perhaps)? As designed? Fixed somewhere? Can't (or will never) be fixed? Am I going mad?
The notesI seem to remember that this worked on Windows, but I can't test ATM because my Windows boxes are undergoing surgery.
Any help, anyone?