Widget::has_focus return integer
d47081 opened this issue · 3 comments
Widget::has_focus
return integer not boolean type
https://docs.gtk.org/gtk3/method.Widget.has_focus.html
I need working code for that
My code returning boolean too
php-gtk3/src/Gtk/GtkWidget.cpp
Line 1983 in 1f24ea6
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