add configure to prevent wshub event execution.

This commit is contained in:
aynakeya
2024-08-27 17:18:12 -07:00
parent 7960299f09
commit 539e8eabe3
4 changed files with 25 additions and 17 deletions

View File

@@ -1,14 +1,14 @@
package xfyne
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/widget"
"reflect"
)
func EntryDisableUndoRedo(entry *widget.Entry) *widget.Entry {
val := reflect.ValueOf(entry).Elem().FieldByName("shortcut").Addr().UnsafePointer()
(*fyne.ShortcutHandler)(val).RemoveShortcut(&fyne.ShortcutRedo{})
(*fyne.ShortcutHandler)(val).RemoveShortcut(&fyne.ShortcutUndo{})
// do nothing because the bug has been fixed in fyne@v2.5.1
return entry
//val := reflect.ValueOf(entry).Elem().FieldByName("shortcut").Addr().UnsafePointer()
//(*fyne.ShortcutHandler)(val).RemoveShortcut(&fyne.ShortcutRedo{})
//(*fyne.ShortcutHandler)(val).RemoveShortcut(&fyne.ShortcutUndo{})
//return entry
}