Page 1 of 1

Problem with Undo/Redo in TextEditor

Posted: Thu Feb 13, 2025 9:45 am
by Allanon
Hello everyone,
I'm writing a simple editor but I'm not able to receive UndoAvailable & RedoAvailable events.
After some readings I tried the TextEditor example and I noticed that Undo button is not enabled when the text is changed so i stopped searching on my source because it could be a bug or something related with my system.
I've enabled the notification for such events like this:

Code: Select all

<texteditor id="sew_text_area" height="400" width="400" align="left" nowrap="true" fontname="Droid Sans Mono" fontsize="14" notify="cursorpos;undoavailable;redoavailable;areamarked;haschanged"></texteditor>
I'm on Linux Manjaro, any hints? Thanks in advance :)

Re: Problem with Undo/Redo in TextEditor

Posted: Thu Feb 13, 2025 3:46 pm
by plouf
i think this is intended
as manual says that by default, only a few notifications are enebled, like button push, all the rest must be manually enabled.
as you said texteditor example in rapagui examples, has this enabled in its notifications and so they work !?

Re: Problem with Undo/Redo in TextEditor

Posted: Thu Feb 13, 2025 5:09 pm
by Allanon
Hi @plouf :) ,
If you look at the code I attached I've included:

Code: Select all

notify="cursorpos;undoavailable;redoavailable;areamarked;haschanged"
in my xml texteditor gadget definition.
I've copied it from the example: what I wanted to say is that the TextEditor example is affected by the same problem: notify has UndoAvailable and RedoAvailable events activated but in the provided example they seems disabled, the undo/redo gadgets don't get enabled as I type stuff because events are not generated at all. Only these events does not work, HasChanged and CursorPos are working as expected.
That's because I was thinking about something wrong with my system :)
Do the example TextEditor's Undo/Redo buttons work for you?

Re: Problem with Undo/Redo in TextEditor

Posted: Thu Feb 13, 2025 5:13 pm
by plouf
yes work here
both button arow turn from blue to black
and also test works as it should in undo/redo fucntions,

i am with windows 11, so maybe its a peculiarity/bug of linux version!?

Re: Problem with Undo/Redo in TextEditor

Posted: Thu Feb 13, 2025 6:51 pm
by Allanon
Thank you for the test! :)
Let's see what other people and Andreas say 8-)

Re: Problem with Undo/Redo in TextEditor

Posted: Tue Feb 25, 2025 10:43 pm
by airsoftsoftwair
Might be a Linux thing. Which version are you using? GTK2 or GTK3?