What does "Handles Event" mean?

I’m not sure what the method call is. I didn’t read it. but I definitely don’t understand “Handles Event”

It’s in this blog post

It’s the text version of an Event Handler.

I was hoping so.

Are there good examples out there?

I’m asking because if I do a search in say XDEV i get hundreds

It’s simply the text-project way to represent an event handler. What do you mean by “are there good examples?”
Do you have a question specific to ScaleFactorChanged?

It’s just the usual question a RAD user might ask.

How do you do this by code?

Do what?

Here’s the information for the ScaleFactorChanged event. It’s just like the Open event, but raised at a different time for a different reason. https://documentation.xojo.com/api/deprecated/window.html#window-scalefactorChanged

Well. This looks like a method call but I can’t figure out the event.

[code]Sub Paint(g As Graphics) Handles Event


g.DrawPicture(mCachedContent, 0, 0)

End Sub

Where is the event that is being called?

That is the Paint event handler.

It looks like this in the IDE, but instead of saying Open or Close it will say Paint

[quote=487767:@Tim Parnell]It’s the text version of an Event Handler.

Thanks. I’ve never noticed that in code, and it’s not something in the LR.
I guess I have some exploring to do. I wonder what else is out there.

Here’s an example from the Paint event in the LR.

Sub Paint(g As Graphics) Var c As Color c = g.Pixel(10, 10)

I finally figured out what I wanted to know.

If I do this, it means I have an event handler specifically for this situation.
Can I make my event handlers more specific?

If you mean ‘only paint on a Friday’, then add code in the event

If you mean ‘can I have an event that does things with a mouse, or the keyboard, or when something changes size’, then just right click, Add Event, and pick the right event from the list

The Xojo help will tell you what events exist for each type of control.

Thanks [quote=487789:@Jeff Tullin][/quote]
What I’m really interested in is improving my programming skills.
Sometimes, the only way I can learn is by asking questions here.
There are alot things I don’t know about and the examples are meant for basic stuff.

You should never have to do this. The text format projects are not meant to be edited directly. Only with the IDE. They are text format for use with version control systems. Do not change them in a text editor.


this may gives you some answers:

Thanks. I’ll leave it alone.