Closed d47081 closed 4 months ago
I need working code for that
My code returning boolean too https://github.com/scorninpc/php-gtk3/blob/1f24ea63a15b3f392a850f280d84573b19409582/src/Gtk/GtkWidget.cpp#L1983
This is a nice example about i'm talking about d47081
I wrote a code to test your problem, you understand?
<?php
Gtk::init();
$win = new GtkWindow();
$win->set_default_size(300, 200);
$win->connect("destroy", "GtkWindowDestroy");
$button = \GtkButton::new_with_label("OK");
$win->add($button);
$button->connect("clicked", function($button) use ($win) {
echo "OK\n";
var_dump($win->has_focus());
var_dump($button->has_focus());
});
$win->show_all();
Gtk::main();
and just after that i can confirm your problem
and now i can search the problem:
gboolean are a alias for integer
and now i can help
you see all work just to change gboolean
to bool
?
as a dev, i'm just asking to you help me too :)
btw, the problem fixed
Just opened your comment, and too late.. it's fixed
I'm not much experienced in cpp (to operate data types there) but in php it may cause errors, so thanks
Widget::has_focus
return integer not boolean type https://docs.gtk.org/gtk3/method.Widget.has_focus.html