scorninpc / php-gtk3

GTK3 extension for PHP
https://andor.com.br/
GNU Lesser General Public License v3.0
112 stars 10 forks source link

Creation of dynamic properties in Gdk entities #106

Open d47081 opened 2 weeks ago

d47081 commented 2 weeks ago

have some warnings when activating only this event:

Deprecated: Creation of dynamic property GdkEvent::$type is deprecated...
Deprecated: Creation of dynamic property GdkEventButton::$type is deprecated...
Deprecated: Creation of dynamic property GdkEventButton::$send_event is deprecated...
Deprecated: Creation of dynamic property GdkEventButton::$time is deprecated...
Deprecated: Creation of dynamic property GdkEventButton::$x is deprecated...
Deprecated: Creation of dynamic property GdkEventButton::$y is deprecated...
Deprecated: Creation of dynamic property GdkEventButton::$axes is deprecated...
Deprecated: Creation of dynamic property GdkEventButton::$state is deprecated...
Deprecated: Creation of dynamic property GdkEventButton::$button is deprecated...
Deprecated: Creation of dynamic property GdkEventButton::$x_root is deprecated...
Deprecated: Creation of dynamic property GdkEventButton::$y_root is deprecated...
Deprecated: Creation of dynamic property GdkEvent::$button is deprecated...
Deprecated: Creation of dynamic property GdkEventKey::$type is deprecated...
Deprecated: Creation of dynamic property GdkEventKey::$send_event is deprecated...
Deprecated: Creation of dynamic property GdkEventKey::$time is deprecated...
Deprecated: Creation of dynamic property GdkEventKey::$state is deprecated...
Deprecated: Creation of dynamic property GdkEventKey::$keyval...
Deprecated: Creation of dynamic property GdkEventKey::$length is deprecated...
Deprecated: Creation of dynamic property GdkEventKey::$hardware_keycode...
Deprecated: Creation of dynamic property GdkEventKey::$keycode is deprecated...
Deprecated: Creation of dynamic property GdkEventKey::$group is deprecated...
Deprecated: Creation of dynamic property GdkEventKey::$is_modifier is deprecated...

Debian 12

Originally posted by @d47081 in https://github.com/scorninpc/php-gtk3/issues/97#issuecomment-2055337355

d47081 commented 2 weeks ago

I believe the answer is here src/Gdk/GdkEventKey.cpp

but not sure where exactly must I fix it as this notice usually means that class operates with not existing entities (e.g. not defined in constructor). Is any parent object for PHP-GTK3 or PHP-CPP issue?

scorninpc commented 2 weeks ago

warnings is not a problem to be fixed. Gtk like warnings alot, and with new PHPs, somethings trigge warnings too!

this causing any real error?

d47081 commented 2 weeks ago

it is problem because event does not (re)define GdkEvent class properly.

in my case it spams debug window where I can't find another important warnings and silintizing them is definitively ugly practic and not a solution. why do you advice that instead of resolve the issue?

I found these lines, maybe somewhere here https://github.com/scorninpc/php-gtk3/blob/master/main.cpp#L507 but no success yet because I don't understand on which level GdkEvent construction start.

scorninpc commented 2 weeks ago

ah ok, i understand!

can you provide a simple code with the problem?

d47081 commented 2 weeks ago

Already found the reason, give me few minutes for PR!

can you provide a simple code with the problem?

This issue happens on:

Common GdkEvent class (that implements GdkEventButton, GdkEventKey) also drop warnings for type, key, button.

d47081 commented 2 weeks ago

I have just found and completed variables initiation in PR #110 for GdkEvent, GdkEventButton, GdkEventKey

all values are nullable by default because at this point we need var init only.

of course it contain implemented features only, and as I can see the classes still under development. anyway problem resolved, the event dump looks well.

additional details in PR description o/