On Thu, 5 Sep 2019 23:01:31 +0200, Mike Wey wrote:

  1. If the widget is a container use the foreach_ function to

recursively set the association.

Thanks, but I don't know which function to use to set the association. When using addProviderForScreen(), the association isn't actually set by a function, it's simply implied by instantiating the CSS object in the TestRigWindow class like this:

class TestRigWindow : MainWindow
{
	string windowTitle = "CSS & Button Labels";
	AppBox appBox;
	CSS css;
	
	this()
	{
		super(windowTitle);
		addOnDestroy(&quitApp);
		
		css = new CSS(); // enable CSS
		
		appBox = new AppBox();
		add(appBox);
		
		showAll();

	} // this() CONSTRUCTOR
	
		
	void quitApp(Widget widget)
	{
		writeln("Bye.");
		Main.quit();
		
	} // quitApp()

} // class myAppWindow

For whatever reason, that's enough to make it work when using addProviderForScreen(), but addProvider() seems to need something else. That's why I'm thinking there must be a function that makes the association.

I looked through the Widget class and found a getStyleContext() function, but no setStyleContext() which struck me as odd. The only place such a function exists is in the NumerableIcon class and I don't see any relationship between that and a common Widget.

Suggestions?