scorninpc / php-gtk3

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

init GtkMenuButton #112 #113

Closed d47081 closed 4 months ago

d47081 commented 4 months ago

Initial commit, methods not implemented yet

112

d47081 commented 4 months ago

Just added set_popup method.

If everything implemented properly, suppose we can merge at this point, because my app requires separated fork and I don't plan to implement another methods for right now

For test:


        $button = new \GtkMenuButton;

        $menu = new \GtkMenu();

        $menu->append(
            \GtkMenuItem::new_with_label("Test 1")
        );
        $menu->append(
            \GtkMenuItem::new_with_label("Test 2")
        );

        $menu->show_all();

        $button->set_popup(
            $menu
        );

        $somegtk->add(
            $button
        );

Reference: https://docs.gtk.org/gtk3/method.MenuButton.set_popup.html