Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LineEdit doesn't receive OnTextChanged event when inside a GroupBox #827

Open
rbeer opened this issue Jan 19, 2024 · 2 comments
Open

LineEdit doesn't receive OnTextChanged event when inside a GroupBox #827

rbeer opened this issue Jan 19, 2024 · 2 comments

Comments

@rbeer
Copy link

rbeer commented Jan 19, 2024

When adding a declarative LineEdit to a GroupBox, the LineEdit's OnTextChanged handler isn't called.

  1. Run below sample code
  2. Enter '123' in left LineEdit (both handlers are called)
  3. Enter '123' in the right LineEdit, inside the GoupBox (only OnEditingFinished is called)

walk_ontextchanged

package main

import (
	"fmt"

	. "github.com/lxn/walk/declarative"
)

func main() {
	MainWindow{
		Title:   "no-onTextChanged-in-groupbox",
		Size:    Size{Width: 400, Height: 100},
		MinSize: Size{Width: 400, Height: 100},
		Layout:  Flow{},
		Children: []Widget{
			LineEdit{
				OnTextChanged: func() {
					fmt.Println("nogroup changed")
				},
				OnEditingFinished: func() {
					fmt.Println("nogroup finished")
				},
			},
			GroupBox{
				Layout: HBox{},
				Children: []Widget{
					LineEdit{
						OnTextChanged: func() {
							fmt.Println("group changed")
						},
						OnEditingFinished: func() {
							fmt.Println("group finished")
						},
					},
				},
			},
		},
	}.Run()
}
@phil616
Copy link

phil616 commented Dec 8, 2024

I have the same problem, have you found any alternative solution?

@phil616
Copy link

phil616 commented Dec 8, 2024

The problem can be solved by wrapping a layer of Composite around TextEdit, but this will destroy the border

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants