cWindow class
#2
You cannot use cWindow directly, it is only a base class from which all windows are inherited. You need to use cLuaWindow. Note that it inherits all cWindow's functions.

For a simple example on showing windows as reactions to commands, see the Debuggers plugin (distributed as built-in with MCServer / https://code.google.com/p/mc-server/sour...uggers.lua ), it has a "/testwnd" command that shows a window filled with custom items and has some processing when the window is closed. You can safely ignore the GCOnTick-related stuff, that's only for internal testing purposes.

In case you are wondering why it is so, why two classes, here's the explanation: It is planned that we'll add a hook that will fire each time a window is opened, closed, or clicked. But MCServer uses different classes than cLuaWindow, so it wouldn't have a cLuaWindow instance to hand to that hook. Instead, we chose to have a common ancestor for all windows, so that all windows can be manipulated the same way. That's the cWindow class.
Reply
Thanks given by: fankins


Messages In This Thread
cWindow class - by fankins - 07-11-2013, 04:22 AM
RE: cWindow class - by xoft - 07-11-2013, 04:28 AM
RE: cWindow class - by fankins - 07-11-2013, 04:45 AM
RE: cWindow class - by xoft - 07-11-2013, 10:21 PM
RE: cWindow class - by fankins - 07-12-2013, 02:20 AM
RE: cWindow class - by xoft - 07-12-2013, 04:22 AM



Users browsing this thread: 1 Guest(s)