scorninpc / php-gtk3

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

Gdk event constants #123

Closed d47081 closed 4 months ago

d47081 commented 4 months ago

Thoughts to implement some constants like Gdk.EventType.DOUBLE_BUTTON_PRESS

I'm currently using static numbers in my app:

$this->gtk->connect(
    'button-press-event',
    function (
        ?\GtkNotebook $self,
        ?\GdkEvent $event
    ) {
        // Close tab on double click
        if ($event->type == 5) // Gdk.EventType.DOUBLE_BUTTON_PRESS
        {
            $this->close();
        }
    }
);

Where is better to define GDK constants in PHP-GTK3?

By the way, here is related PR https://github.com/scorninpc/php-gtk3/pull/110 I'm still waiting for merge to continue

scorninpc commented 4 months ago

https://github.com/scorninpc/php-gtk3/blob/master/main.cpp#L403 https://github.com/scorninpc/php-gtk3/blob/master/main.cpp#L450

d47081 commented 4 months ago

Thanks, found it!