// used for label[] on Notebook
// used for button[] on Dialog?
// columns[] ?
- this.packChild(child, i, 0, 0, child.get_prop("* prop").val); /// fixme - this is a bit speciall...
+ this.packChild(child, i, 0, 0, child.get_prop("* prop").val); /// fixme - this is a bit speciall...
continue;
}
// add a ref... (if 'id' is not set... to a '+' ?? what does that mean? - fake ids?
) + " );");
return;
}
+ var childcls = this.file.project.palete.getClass(child.fqn()); // very trusting..
+ var is_event = childcls.inherits.contains("Gtk.EventController") || childcls.implements.contains("Gtk.EventController");
+ if (is_event) {
+ this.addLine(this.ipad + "this.el.add_controller( child_%d.el );".printf(i) );
+ return;
+ }
+
+
switch (this.node.fqn()) {
return;
default:
- this.addLine(this.ipad + "this.el.add( child_" + "%d".printf(i) + ".el );");
+ // gtk4 uses append!!!! - gtk3 - uses add..
+ this.addLine(this.ipad + "this.el.append( child_" + "%d".printf(i) + ".el );");
return;
this.map = new Gee.ArrayList<Usage>();
this.generic_child_widgets = new Gee.ArrayList<string>();
+ this.generic_widget_children = new Gee.ArrayList<string>();
this.all_no_parent = new Gee.ArrayList<string>();
var top = new Gee.ArrayList<string>();
top.add("*top");
this.add_special_children(k, "Gtk.Menu", "_menu");
}
var u = new Usage( alltop, this.generic_child_widgets);
- //GLib.debug("add Usage: %s", u.to_string());
-
this.map.add(u);
-
+ u = new Usage( this.generic_child_widgets, this.generic_widget_children);
+ this.map.add(u);
+
foreach(var key in pr.gir_cache.keys) {
var gir = pr.gir_cache.get(key);
this.build_class_children_from_props(gir.classes);
this.init_node_defaults();
this.init_child_defaults();
- //foreach(var m in this.map) {
- // GLib.debug("Usage: %s", m.to_string());
- // }
+ foreach(var m in this.map) {
+ GLib.debug("Usage: %s", m.to_string());
+ }
}
// containers that can contain only certial types of children, and should be ignored from the general bulk add.
Gee.ArrayList<string> generic_child_widgets;
+ Gee.ArrayList<string> generic_widget_children; // mostly events...
Gee.ArrayList<string> all_no_parent;
/*
string[] special_containers = {
public void build_generic_children(Gee.HashMap<string,GirObject> classes)
{
+
+ GLib.debug("Build Generic Children");
foreach(var cls in classes.values) {
var fqn = cls.fqn();
//GLib.debug("Class %s is depricated", cls.fqn());
continue;
}
-
- if (!cls.inherits.contains("Gtk.Widget") && !cls.implements.contains("Gtk.Widget")) {
+ var is_widget = cls.inherits.contains("Gtk.Widget") || cls.implements.contains("Gtk.Widget");
+ var is_event = cls.inherits.contains("Gtk.EventController") || cls.implements.contains("Gtk.EventController");
+ if (!is_widget && !is_event) {
continue;
}
if (cls.is_abstract) {
if (is_black) {
continue;
}
- this.generic_child_widgets.add(fqn);
-
-
+ GLib.debug("Build Generic Children - add %s", fqn);
+ if (is_event) {
+ this.generic_widget_children.add(fqn);
+ } else {
+ this.generic_child_widgets.add(fqn);
+ }
//this.add_special_children(fqn, "Gtk.Menu", "_menu"); // fake propety
}
prop.name == "related_action" || // not sure if we should disable this.
prop.name == "visible_child" ||
prop.name == "attach_widget" || // gtk menu
- prop.name == "relative_to" // popover
-
+ prop.name == "relative_to" || // popover
+ // gtk4
+ prop.name == "default_widget" ||
+ prop.name == "focus_widget" ||
+ prop.name == "key_capture_widget" ||
+ prop.name == "root" ||
+ prop.name == "layout_manager" ||
+ 1 == 0
) {
continue;
var propcls = this.getClass(prop.type);
- if (propcls == null) {
+ if (propcls == null || propcls.name == "GLib.Object") { // no point in adding generic glib objects
continue;
}
}
+ // is child a Event - handled by nodetovala...
+
// any other combo?
switch(parent.fqn()) {
case "Gtk.Dialog":