Quantcast LoTROInterface - View Single Post - Trouble with window not triggering events
View Single Post
  #1  
Unread 04-17-2017, 08:28 AM
gillothrin gillothrin is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Apr 2017
Posts: 6
Trouble with window not triggering events

Hello,

I'm having trouble with Lotro.UI.Window events. I understand that there's some sort of caveat here but I seem to miss it.

Code:
MyWindow = class(Turbine.UI.Window());
function MyWindow:Constructor()
	Turbine.UI.Window.Constructor(self);	
	self.defaultWidth = 220;
	self.defaultHeight = 100;
	self:SetMinimumHeight(self.defaultHeight);
	self:SetSize(self.defaultWidth, self.defaultHeight);
	self:SetMouseVisible(true);
	self:SetWantsUpdates(true); -- seems like it doesn't do anything
	local bbg = Turbine.UI.Color(rgb(7),rgb(32),rgb(71));
	self:SetBackColor( bbg );
	self:SetPosition(100,100);
	self:SetVisible(true);
	Turbine.Shell.WriteLine((Dump(self.MouseDownHandler));
	--self.MouseDown = function(s,a) debug("MouseDown"); end; -- not working
	self.MouseDown = self.MouseDownHandler; -- not working
end

function MyWindow:MouseDownHandler(s,a)
	Turbine.Shell.WriteLine("MouseDownHandler");
end
--Not working either
--function MyWindow:MouseDown(s,a)
--	Turbine.Shell.WriteLine("MouseDown");
--end
So it paints but there are no events recorded. However any added control to the window works fine. To make sure that the windows answers, do I have to make sure it has a "shadow" control to get the events?

TIA

Last edited by gillothrin : 04-17-2017 at 08:44 AM. Reason: (I've seemed to have posted this in the wrong topic, sorry)
Reply With Quote