Re: [Vala] access static method



Thank you very much!

"global::" That's what i'm looking for...


Am 30.03.19 um 23:32 schrieb Abderrahim Kitouni:
Hi,

It seems you solved your issue, but here is the answer to your question.
On ث, مارس 26, 2019 at 5:07 م, Wolfgang Mauer <wolfgang mauer kabelmail de> wrote:
Thanks for your answer...
That's what i thought
but if i try to use "valaDevelop.get_text" inside method mymethod in class abc
the compiler say:
/home/wolfgang/Projekte/vDevelop/valaDevelop/completion_provider.vala:59.80-59.99: error: The name `get_text' does not exist in the context of `valaDevelop.valaDevelop'

This means that it's trying to lookup the get_text method in the valaDevelop class which is inside the valaDevelop namespace.

There is a construct in vala for accessing this anyway, IIRC global::valaDevelop.get_text should get to the method you want.

However, I think the real solution is to use sensible names for your classes/methods and not have to figure out which of the similarly named things the symbol resolver is going to pick. For instance, your valaDevelop class could be named Main.

HTH,
Abderrahim





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]