Phase 3: generator emits set_items string form for ToolBar/MenuBar (fixes case 03 ambiguity)

This commit is contained in:
cnmcdee committed 2026-11-30 13:05:47 +00:00
1 parent 2f7abd710d
commit 294edc495e
2 files changed
+9 -21

No files matched your search

+1 -1
View File
@@ -680,7 +680,7 @@ pub fn selftest_step(app: &Shared) {
"set_size_grip(false)",
"set_show_captions(false)",
"set_button_width(48)",
"set_items({\"File\", \"Edit\"})",
"set_items(\"File|Edit\")",
"win_x, win_y",
"override_redirect",
"_NET_WM_STATE_FULLSCREEN",
+8 -20
View File
@@ -1522,16 +1522,10 @@ fn emit_widget_props(o: &mut String, w: &Widget, m: &XFrameMap, var: &str, kind:
}
} else if t == "ToolBar" {
if has("items") {
o.push_str(&format!(" {var}.w.set_items({{"));
let mut first = true;
for item in split_on('|', &prop_or(w, "items", "")) {
if !first {
o.push_str(", ");
}
first = false;
o.push_str(&format!("\"{}\"", esc_c(&item)));
}
o.push_str("});\n");
o.push_str(&format!(
" {var}.w.set_items(\"{}\");\n",
esc_c(&prop_or(w, "items", ""))
));
}
if w.props.contains_key("show-captions") {
o.push_str(&format!(
@@ -1567,16 +1561,10 @@ fn emit_widget_props(o: &mut String, w: &Widget, m: &XFrameMap, var: &str, kind:
}
} else if t == "MenuBar" {
if has("menus") {
o.push_str(&format!(" {var}.w.set_items({{"));
let mut first = true;
for item in split_on('|', &prop_or(w, "menus", "")) {
if !first {
o.push_str(", ");
}
first = false;
o.push_str(&format!("\"{}\"", esc_c(&item)));
}
o.push_str("});\n");
o.push_str(&format!(
" {var}.w.set_items(\"{}\");\n",
esc_c(&prop_or(w, "menus", ""))
));
}
} else if t == "SpinEdit" {
let lo = prop_int(w, "minimum", 0);