WiFi.onEvent(WiFiEvent) problem

I need to use the callback function from a class.
For testing a wrote the following lines

class Test {
  public:
    Test();	 
	void WiFiEvent(WiFiEvent_t event);
};
Test::Test() {
	WiFi.onEvent(WiFiEvent);  
}

void Test::WiFiEvent(WiFiEvent_t event) {
    Serial.printf("[WiFi-event] event: %d\n", event);
}

this results in "error: invalid use of non-static member function"
when I declare it as static, I receive an other error

 static void WiFiEvent(WiFiEvent_t event);

what can I do?
many thanks

May be this will help?

Suppose you create multiple instances of the Test (dumb name) class. Which instance is supposed to care when the event happens?

If you assure us that you'll only ever have one instance, then it's rather pointless to have a class.

Tefi:
when I declare it as static, I receive an other error

 static void WiFiEvent(WiFiEvent_t event);

Please tell us what 'other error' you receive.