On Tue, 04 Feb 2014 22:23:47 GMT, Mike Wey wrote:

On Tue, 04 Feb 2014 19:16:04 GMT, E.S. Quinn wrote:

:/ Now that I actually have the updated GtkD, the test program doesn't run at all. (I put an .ensureUpdate call in there too, immediately after the addUiFRomString() call. It crashes with an Access Violation, and complains that the Actions weren't added.

Do you have an small example that fails?

I pared down my test program to a very minimal one, and this still fails:

module uimanagertest;
import std.stdio;

import gtk.UIManager;
import gtk.Menu;
import gtk.MenuBar;
import gtk.Action;
import gtk.ActionGroup;
import gtk.MainWindow;
import gtk.Main;
import gtk.Window;
import gtk.Widget;

version (DigitalMars) {
	version (Windows) pragma (lib, "GtkD.lib");
	version (Posix) pragma (lib, "gtkd-1");
}	

class W : MainWindow {
	ActionGroup actions;
	UIManager uiman;
	Widget menubar;
	
	enum uistring = `
		<ui>
		<menubar>
			<menu action="Menu">
				<menuitem action="Click"/>
			</menu>
		</menubar>
		</ui>
	`;
	
	this() {
		super("UIManager Test");
		actions = new ActionGroup("Test");
		uiman = new UIManager();
		
		auto action = new Action("Click", "Click me", "This is clickable.", StockID.ABOUT);
		action.addOnActivate((Action a) {
			writeln("I've been activated!");
		});
		actions.addAction(action);
		
		action = new Action("Menu", "Menu", "This is a placeholder.", "");
		actions.addAction(action);
		
		uiman.insertActionGroup(actions, 0);
		uiman.ensureUpdate();
		uiman.addUiFromString(uistring, uistring.length);
		uiman.ensureUpdate();
		menubar = (uiman.getWidget("/ui/menubar"));
		add (menubar);
		menubar.show();
		
		
	}
}