VLayout is different in 3.13 and 3.14

Hi,

I’m writing a sc program that I need to share with other people. I made a GUI for a bunch of synths using Ndefs. I can’t use the default Ndef.gui because of styling issues which were solved by a custom GUI.

I developed the thing on SC 3.13.1 in NixOS. When trying to run it in SC 3.14.1 on MacOS it breaks. I discovered it’s because VLayout() changed with the version, and doesn’t implement .asView in 3.14.1.

I have 3 windows. This is the function building the GUI for the Ndef parameters:

var make_ndef_gui = { |ndef|
	var layout = VLayout();
	var width = 160;
	var height = 30;
	var fm_input;

	layout.add(StaticText().string_(ndef.key.asString).font_(Font.default.boldVariant));

	SynthDescLib.global.at(ndef.source).controls.do { |ctl, i|
		if (ctl.rate != \audio and: { ctl.name != \out }) {
			var kn = EZNumber(layout,
				bounds: Rect(10,10,width,height),
				label: ctl.name,
				controlSpec: Spec.specs[ctl.name] ?? ControlSpec(0,1),
				action: { |kn| ndef.set(ctl.name, kn.value.debug("%:%".format(ndef.key, ctl.name))) },
				initVal: ctl.defaultValue,
				labelWidth: width - 30,
				layout: \horz,
			);
			// layout.add(HLayout(kn.labelView, kn.numberView, kn.knobView)); // EZKnob
			layout.add(HLayout(kn.labelView, kn.numberView));
		};
	};

	fm_input = EZNumber(layout,
		bounds: Rect(10,10,width,height),
		label: "fm_in",
		controlSpec: ControlSpec(0, num_voices-1, \lin, step: 1, units: ""),
		action: { |num| ndef.map(\in, Ndef((\voice_++num.value.asInteger).asSymbol.debug)) },
		labelWidth: width - 30,
		layout: \horz,
	);
	layout.add(HLayout(fm_input.labelView, fm_input.numberView));

	w.layout.add(layout);
};

On 3.13.1 (NixOS) works fine.
On 3.14 (MacOS) throws: ^^ERROR: Message 'asView' not understood.

I checked and it certainly doesn’t exist in 3.14.1.

VLayout.findRespondingMethodFor(\asView); 
// 3.13.1 (NixOS) -> Layout:asView
// 3.14.1 (MacOS) -> nil

Is there a way to make this work on both versions?
In case it’s not possible or overly complicated, how would the code in the function translate to v3.14.1? Does VLayout() accept EZGui objects without needing to get the inner views in 3.14.1?

UPDATE:
I upgraded to 3.14.1 on NixOS. Strangely enough, the code works, with some quirks, but it does show the windows and GUI elements. Any ideas why it doesn’t work on MacOS?

GitHub says the file hasn’t been touched in 10 years, so unless something else has touched it, it won’t be that :slight_smile:

One possible explanation is: if you installed an extension (quark or other) that provides asView in 3.13 on your Linux machine, and then did not install it on your Mac, I think this would explain all the symptoms.

hjh

1 Like

I think it has to do with different versions of Qt installed. I’m looking into it.

also looking into installed quarks.

thanks : )

1 Like

If it were that, you might get a “primitive failed” error, but you definitely wouldn’t get a “does not understand” error.

“Does not understand” is always about what is defined in the class library (including extensions). If the class library is identical on two different machines, then it’s impossible to get “does not understand” on one machine and not get it on the other.

Therefore, the class libraries are not the same on your two machines.

Since upgrading one of them, they’re now on the same SC version, so the built-in class libs should be the same. So, the most likely remaining place that could be different is in extension classes.

EDIT: You could check the location of asView defined on layouts by running: VLayout.findRespondingMethodFor(\asView).filenameSymbol; on the machine where asView works – this will tell you exactly which folder, and narrow down your search instantly.

hjh

1 Like