ATSynEdit install from OPM
lazarus / 1-Linux
----------------------------------------------------------------------
polpero · 2024-12-16 14:23
Hi
ATSynEdit won't install from OPM with Laz 4.0 RC1...
checking ATSynEdit calls for the dependencies to be added
and continuing starts the process of installing and building.
Rebuilding is successfull but checking for ATSynEdit in the OPM shows
it is not installed...
When adding the define: WITH_GTK2_IM in the Configure/Build Laz...
but I get the error message: "Error: argument to "-d" is missing"
Am I missing something?
The OS is linux Mint
----------------------------------------------------------------------
AlexTP · 2024-12-16 17:38
Quote from ATSynEdit wiki page:
Quote==Compilation errors==
'''IME error on GTK2.'''
You may get this error:
atsynedit_adapter_gtk2ime.pas(131,5) Error: Identifier not found
"IM_Context_Set_Cursor_Pos"
To fix it, edit the file "atsynedit/atsynedit_package.lpk" and remove
this block there:
Alternative solution when symbol "IM_Context_Set_Cursor_Pos" cannot be
found: you need to open IDE dialog "Tools / Configure 'Build
Lazarus'", and there enable the define: WITH_GTK2_IM; then recompile
the IDE.
----------------------------------------------------------------------
polpero · 2024-12-17 19:17
Hi Alex
Thanks for the answer
This time though the topic is different
I have applied the alternative method
Quoteadding the define: WITH_GTK2_IM in the Configure/Build Laz...
dlg
and I got this error message:
Quote"Error: argument to "-d" is missing"
So the question is:
what is the compiler looking as -d missing parameter?
----------------------------------------------------------------------
AlexTP · 2024-12-18 06:56
-d Defines the symbol
So you have empty lines in the 'Defines' IDE list?
----------------------------------------------------------------------
backprop · 2024-12-18 10:47
Click on "Defines" button and add WITH_GTK2_IM, then check it. But
then another problem arrives...
When rebuild IDE, this information popup:
Code: [Select]Unable to find file "datetimepicker.pas".
If it belongs to your project, check search path in
Project -> Compiler Options -> Search Paths -> Other Unit Files. If
this file belongs to a package, check the appropriate package compiler
options. If this file belongs to Lazarus, make sure compiling clean.
If the file belongs to FPC then check fpc.cfg. If unsure, check
Project -> CompilerOptions -> Test
I do not use datetimepicker nor ATSynEdit - this is just after
recompiling IDE with such parameter. And I have created similar thread
few months ago, but there is no solution. And instead ATSynEdit which
I used in the past without problem, now I need to use Lazarus' SynEdit
which is full of bugs and memory leaks...
Lazarus is full of strange bugs...
For the author: is it this WITH_GTK2_IM parameter really important for
functionality? In earlier versions that was not existed.
----------------------------------------------------------------------
AlexTP · 2024-12-18 13:28
Quote>is it this WITH_GTK2_IM parameter really important for
functionality? In earlier versions that was not existed.
It is needed to allow CJK users to enter CJK text via Input Method
Editor (IME).
----------------------------------------------------------------------
polpero · 2024-12-18 20:25
QuoteSo you have empty lines in the 'Defines' IDE list?
no
and no space at beginning of line
----------------------------------------------------------------------
CM630 · 2026-06-22 10:40
Quote from: AlexTP on December 16, 2024, 06:38:28 pmQuote from
ATSynEdit wiki page:
Quote==Compilation errors==
'''IME error on GTK2.'''
You may get this error:
atsynedit_adapter_gtk2ime.pas(131,5) Error: Identifier not found
"IM_Context_Set_Cursor_Pos"
To fix it, edit the file "atsynedit/atsynedit_package.lpk" and remove
this block there:
Alternative solution when symbol "IM_Context_Set_Cursor_Pos" cannot be
found: you need to open IDE dialog "Tools / Configure 'Build
Lazarus'", and there enable the define: WITH_GTK2_IM; then recompile
the IDE.
1. Currently this block is not in the .lpk.
Code: Pascal [Select][+][-]window.onload = function(){var x1 =
document.getElementById("main_content_section"); if (x1) { var x =
document.getElementsByClassName("geshi");for (var i = 0; i
2. Adding WITH_GTK2_IM; in Compiler option does not help, it results
in
Error: malformed parameter: -dWITH_GTK2_IM;
3. If the ; is removed (WITH_GTK2_IM) building is possible. But then
there are problems with other packages:
Fatal: Can't find unit GLGtkGlxContext used by OpenGLContext
----------------------------------------------------------------------
AlexTP · 2026-06-22 12:19
`Quote from ATSynEdit wiki page:` was given here in 2024 december.
Later I updated the wiki, https://wiki.freepascal.org/ATSynEdit
it now don't contain that outdated info, look in the wiki chapter
'Compilation errors'.
Quote==Compilation errors==
'''IME error on GTK2.'''
You may get this error:
atsynedit_adapter_gtk2ime.pas(131,5) Error: Identifier not found
"IM_Context_Set_Cursor_Pos"
Solution: you need to open IDE dialog "Tools / Configure 'Build
Lazarus'", and there enable the define: WITH_GTK2_IM. Then recompile
the IDE.
Is wiki OK now?
----------------------------------------------------------------------
CM630 · 2026-06-22 13:33
Still WITH_GTK2_IM breaks OpenGLContext, that is why I hoped that
editing the .lpk might solve the issue.
Maybe I shall address the issue in some other section...
----------------------------------------------------------------------
AlexTP · 2026-06-22 13:56
That 'define' is official define of IDE. So it must work with all the
compoennts. With OpenGL too. I guess it is a opengl component's bug.
----------------------------------------------------------------------
CM630 · 2026-06-23 08:46
I did:
1. Close Lazarus
2. cd /usr/share/lazarus/4.8.0
3. sudo make all OPT="-dWITH_GTK2_IM"
Since that moment things seem to work, but I have not tested much.
----------------------------------------------------------------------
backprop · 2026-06-23 15:12
IIRC, I have had the same issue and similar thread about long time
ago...
Why this is set by default instead to be otherwise? ATSynEdit is much
better than original and I used it long time ago when IME "feature"
didn't existed at all, but when introduced, there was no way to
install it and disble it properly.
Why not create two versions instead with proper installation? One with
IME one without if is still not possible to install it correctly?
Currently is just annoying to fix things and try and error
installation every single time...
----------------------------------------------------------------------
AlexTP · 2026-06-23 19:02
QuoteWhy this is set by default instead to be otherwise?What 'this' is
set by default? If you mean the GTK/IME define word, it is NOT enabled
by default since some months.
QuoteWhy not create two versions instead with proper installation? Two
versions of what? Do you suggest that I should make 2nd version of
atsynedit and add there (only there) IME? That is bad suggestion, I
dont agree.
----------------------------------------------------------------------
backprop · 2026-06-24 04:00
Quote from: AlexTP on June 23, 2026, 09:02:19 pmWhat 'this' is set by
default? If you mean the GTK/IME define word, it is NOT enabled by
default since some months.
Since you introduced this,I was unable to install it with various
weird and unrelated compiler errors as I mentioned here. But that was
few years ago...
QuoteTwo versions of what? Do you suggest that I should make 2nd
version of atsynedit and add there (only there) IME? That is bad
suggestion, I dont agree.
Two versions of installation, .lpk using different xml, parameters,
whatever now you proposed as a "fix". Forcing anyone to "fix"
installation files to eleminate behavior 95% or so people do not need
by default is bad practice...
But never mind, it is your choice.
----------------------------------------------------------------------
CM630 · 2026-06-24 05:37
Currently there are three version of ATSynEdit in OPM.
If there is a fourth one, that make install easier, I would welcome
it.
----------------------------------------------------------------------
AlexTP · 2026-06-24 05:41
Currently there is 1 version in OPM: atsynedit.
atsynedit_ex / atsynedit_cmp packages are not versions, but features.
----------------------------------------------------------------------
backprop · 2026-06-24 06:07
I would welcome even 10 versions in OPM, if every is clearly marked
what is what. Good components Alex make but since these issues IME
introduced, I stop using it long time ago...
Though, GTK2 will hopefully be history soon and GTK3 default, as
Željko seems fixing the last drops of missing parts for it... It was
long journey, even GTK4 is actual now in GNOME distros...
----------------------------------------------------------------------
AlexTP · 2026-06-24 06:23
If atsynedit gives problems with GTK2 IME, these methods can be
commented out, it is not hard:
Code: Pascal [Select][+][-]window.onload = function(){var x1 =
document.getElementById("main_content_section"); if (x1) { var x =
document.getElementsByClassName("geshi");for (var i = 0; i uses ...
{$ifdef LCLGTK2} ATSynEdit_Adapter_ime_gtk2, {$endif} ... {$ifdef
LCLGTK2} FAdapterIME:= TATAdapterGTK2IME.Create; {$endif}
----------------------------------------------------------------------
backprop · 2026-06-24 07:08
Quote from: AlexTP on June 24, 2026, 08:23:36 amIf atsynedit gives
problems with GTK2 IME, these methods can be commented out, it is not
hard:
Imagine that I use several dozen of packages and on each I need to do
some manual fix on every new version simply to reinstall it. Well, I
would simply stop using it. That is about bad practice I mentioned.
And if you expect that people will do that hard work and inspect every
line of your code, you simply misjudge them.
Secondly, as I wrote alerady 2 years ago, when tried to use you "fix",
it yiels that datetimepicker components misiing from some unexplained
reason when trying to recompile your components, even I do not use
datetimepicker. Thus was cascade and irrational behavior of compiler
for some reason etc, but just on your components.
----------------------------------------------------------------------
AlexTP · 2026-06-24 08:12
The usual sol for such cases is a 'define word' in an INC-file. So I
just added it.
+ add: new define "AT_IME" in atsynedit_defines.inc, it is now global
enable-flag for IME (Input Method Editor) additional code for all
OS/widgetsets
It is in the Git. Will be in the OPM soon. Hope it helps. Flag is
present by default for my own program.