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

Memo.VScrollBar doesn't exist #58

Open
shaunroselt opened this issue Mar 6, 2023 · 2 comments
Open

Memo.VScrollBar doesn't exist #58

shaunroselt opened this issue Mar 6, 2023 · 2 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@shaunroselt
Copy link
Contributor

Normally in Delphi I would do Memo1.VScrollBar.Value := self.Memo1.VScrollBar.Max; to scroll to the bottom of a Memo. I tried doing this in Python, but it doesn't work.

Here's a code example in Python:

self.Memo1 = Memo(self)
self.Memo1.Parent = self
self.Memo1.Align = "Client"

for i in range(1000):
    self.Memo1.Lines.Add("This is a test: " + str(i))

self.Memo1.VScrollBar.Value = self.Memo1.VScrollBar.Max

The error is: AttributeError: 'NoneType' object has no attribute 'Max'

Or am I maybe using it wrong in Python?

@Priyatham10 Priyatham10 self-assigned this Mar 6, 2023
@Priyatham10 Priyatham10 added the help wanted Extra attention is needed label Mar 6, 2023
@lmbelo
Copy link
Member

lmbelo commented Mar 7, 2023

VScrollBar returns nil for native presentation. Check it out: https://docwiki.embarcadero.com/Libraries/Alexandria/en/FMX.ScrollBox.TCustomPresentedScrollBox.VScrollBar

AttributeError: 'NoneType' object has no attribute 'Max'

When it says 'NoneType', it means you are accessing a nil reference from Delphi.

@shaunroselt
Copy link
Contributor Author

Ah, I see. That makes sense.

Do you maybe know how I can scroll to the bottom of the memo if there aren't any styles that are used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants