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

[View] pane changes on non-shown face remain undetected #5441

Open
hiiamboris opened this issue Dec 6, 2023 · 0 comments
Open

[View] pane changes on non-shown face remain undetected #5441

hiiamboris opened this issue Dec 6, 2023 · 0 comments
Labels

Comments

@hiiamboris
Copy link
Collaborator

Describe the bug

This creates troubles for my sole user of scrollpanel style:

  • init sets reactions before do or on-create
  • reactions cause by do or on-create are skipped, leading to the state loss
  • only since on-created reactions start to work

When pane is modified from inside view [do [...]] or on-create, I can't detect that.

To reproduce

Run this:

Red [needs: view]

system/view/VID/styles/test: [
	template: [
		default-actor: 'on-click
		type:  'panel
		size:  200x200
		color: cyan
	]
	init: [react [
		print ["pane size=" n: length? p: self/pane]
		if n > 0 [dump-face last p]
	]]
]
view [
	t: test [] loose rate 1
	on-create	[print "def" append t/pane layout/only [at 20x30 text "def"]]
	; on-created	[print "ghi" append t/pane layout/only [at 30x50 text "ghi"]]
	; on-time		[print "jkl" append t/pane layout/only [at 40x70 text "jkl"]]
	do			[print "abc" append t/pane layout/only [at 10x10 text "abc"]]
]

Output does not reflect 2 faces in the pane:

pane size= 0
abc
def

If you uncomment (any of) commented lines, those changes will be seen:

pane size= 0
abc
def
ghi
pane size= 2
 Type: text Style: text Offset: (20, 30) Size: 80x23 Color: none Text: "def"
pane size= 3
 Type: text Style: text Offset: (30, 50) Size: 80x23 Color: none Text: "ghi"
jkl
pane size= 3
 Type: text Style: text Offset: (30, 50) Size: 80x23 Color: none Text: "ghi"
pane size= 4
 Type: text Style: text Offset: (40, 70) Size: 80x23 Color: none Text: "jkl"

Expected behavior

Reactions detecting changes.
Also ideally one event per change, not two.

Platform version

-----------RED & PLATFORM VERSION----------- 
RED: [ branch: "master" tag: #v0.6.4 ahead: 5060 date: 22-Nov-2023/14:24:25 commit: #34f26dff0dfc467b9df7862f59c5220c5f508110 ]
PLATFORM: [ name: "Windows 10" OS: 'Windows arch: 'x86-64 version: 10.0.0 build: 19044 ]
--------------------------------------------
@hiiamboris hiiamboris added the GUI label Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant