[gtkada] Question wrt using the new paradigm for connecting handlers to signals

Rob Groen robgr at xs4all.nl
Thu Oct 22 17:06:12 CEST 2015


 

Additionally, assume we have 

my_text_combo : gtk_combo_box_text; 

procedure Handler (Object : access gtk_combo_box_text_record'class); 

then the statement 

my_text_combo.on_changed (handler'access, false); 

results in a compiler error: expected type "Cb_GObject_Void" defined at
gtk-combo_box.ads:685 found type access to procedure "Handler" defined
at line <>. 

Cb_Object_Void is declared as: 

type Cb_GObject_Void is not null access procedure (Self : access
Glib.Object.GObject_Record'Class); 

I would have expected that the compiler complains about actual type of
"Handler" not being (subtype) compatible / conformant to the formal type
Cb_Gtk_Combo_Box_Void 

I can't find an obvious way to do a type conversion without running into
accessibility level violations, and I guess that the type conversion
isn't even allowed. 

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/gtkada/attachments/20151022/c672b679/attachment.html>


More information about the gtkada mailing list