Problem with Undo/Redo in TextEditor

Discuss GUI programming with the RapaGUI plugin here
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Problem with Undo/Redo in TextEditor

Post 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 :)
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Problem with Undo/Redo in TextEditor

Post 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 !?
Christos
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Problem with Undo/Redo in TextEditor

Post 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?
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Problem with Undo/Redo in TextEditor

Post 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!?
Christos
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Problem with Undo/Redo in TextEditor

Post by Allanon »

Thank you for the test! :)
Let's see what other people and Andreas say 8-)
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with Undo/Redo in TextEditor

Post by airsoftsoftwair »

Might be a Linux thing. Which version are you using? GTK2 or GTK3?
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Problem with Undo/Redo in TextEditor

Post by Allanon »

I missed your reply sorry!
I'm on Manjaro + KDE Plasma, I think it should use GTK3, looking at the package manager both GTK2 & 3 are installed.
Here are my system specs:

Code: Select all

██████████████████  ████████   ------------------ 
██████████████████  ████████   OS: Manjaro Linux x86_64 
██████████████████  ████████   Host: 32371P2 ThinkCentre M92p 
████████            ████████   Kernel: 6.6.84-1-MANJARO 
████████  ████████  ████████   Uptime: 1 hour 
████████  ████████  ████████   Packages: 2104 (pacman), 7 (flatpak), 3 (snap) 
████████  ████████  ████████   Shell: bash 5.2.37 
████████  ████████  ████████   Resolution: 1920x1080 
████████  ████████  ████████   DE: Plasma 6.3.3 
████████  ████████  ████████   WM: KWin 
████████  ████████  ████████   Theme: [Plasma], Breeze-Dark [GTK2], Breeze [GTK3] 
████████  ████████  ████████   Icons: [Plasma], breeze [GTK2/3] 
████████  ████████  ████████   Terminal: konsole 
                               CPU: Intel i5-3470T (4) @ 3.600GHz 
                               GPU: Intel HD Graphics 
                               Memory: 2015MiB / 7737MiB 
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with Undo/Redo in TextEditor

Post by airsoftsoftwair »

Allanon wrote: Sat Apr 05, 2025 1:50 pm I'm on Manjaro + KDE Plasma, I think it should use GTK3, looking at the package manager both GTK2 & 3 are installed.
The question is which RapaGUI version you're using. For x64 Linux there are RapaGUI builds for GTK2 and 3. Please check the filesizes to see which one you're using :)
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Problem with Undo/Redo in TextEditor

Post by Allanon »

Oh man, sorry, I didn't get right your question! :D

rapagui.hwp size: 6.438.627 bytes
:P
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with Undo/Redo in TextEditor

Post by airsoftsoftwair »

Ok, I can reproduce it here. Looks like a bug or a limitation in wxWidgets. I'll examine.
Post Reply