Closed d47081 closed 3 months ago
index
and trailing
pango_layout_xy_to_index
use int, so you need to use int too. but, gint is a int aliasgint
is int
alias for Gtk environment, but I see different implementations in code and asking which of them is correct. will use gint
sosad we can't make it 1:1 compatible with gtk api.. and I can't find any similar method in code available.
p.s. just created question here https://github.com/CopernicaMarketingSoftware/PHP-CPP/issues/534
p.p.s. about boolean values found these constructions to operate: Php::Type::True
, Php::Type::False
Php::Value ret = pango_layout_xy_to_index(PANGO_LAYOUT(instance), x, y, index_, trailing);
if(ret.type() == Php::Type::True) {
return Php::Type::True;
} else {
return Php::Type::False;
}
Mostly done, see you there https://github.com/scorninpc/php-gtk3/pull/144
is it okay that function API will be changed of that? maybe you too don't know how to make it as linked argument back or that's just impossible with php-cpp
this is a pattern since php-gtk1, it's not ok use reference args with php
Yes, finally got it
GTK documentation https://docs.gtk.org/Pango/method.Layout.xy_to_index.html
I have following draft:
This implementation process
x
andy
arguments properly, but:index_
andtrailing
values generated as php parameters?int
orgint
there?btw, app code fragment for tests where I'm trying to get link address on middle button click by this feature