Getting a certain Propoerties value to a label

I have a class called “japanese”
It has three properties (all strings) =inu

I have a weblabel1 and I wish to assign the value of the property to that to the text property

I could use weblabel1.shown —> --> (inu!)

But, because a lot more than just filling in the .text goes on I wish to Subclass WebLabel and be able to fill in the Target Property int he IDE


and finally in the open event call (Pseudo code)


Perhaps I can get there using introspection?

please show how you are creating “Japanese” and where/how it is instantiated

simple source is here:

Something like this?
(drag the .xojo_code into the Navigator to use it)

Edit: I’m not sure if you can assign a class to a property using the Inspector in the IDE.

Thanks Tim.

The DogLabel will always return the value of

I wish to set a property target_property where target_property=“”

Are you always trying to get the Dog property though? I guess I don’t have the complete picture.

How is the control determining which property to use, or is that what you’re trying to select in the Inspector?
If that’s your goal, then yes you were on the right track with introspection!

Is target_property always the Japanese class?

is that what you’re trying to select in the Inspector? -->yes

target_property always the Japanese class?–>Yes

I could build a a case stamtent, but there must be a more elegant way

Take a look at this:

I’ve implemented it as JapaneseLabel now. You set the clsJapanese object to it, and it will use the property value (it must be a string) for whatever property you type into the IDE inspector. It will raise an exception if it couldn’t find the property you typed in the IDE.

(post to bump thread because I edited my placeholder post)

Freaking Awesome Tim. Thanks!

(Now its time to dig in and really understand what you did!)