Nick Gammon said:
Is this fixed yet? I see on your website a fix entitled "Fixed misspelling of 'cancel' ...".
Which goes on to say '... that would hinder cancelmousedown' specifically.
Nick Gammon said:
Well, you are talking about cancelmouseover, not cancelmousedown, right?
Oops, yes. Minor brain fart which I'll remedy so others don't get confused reading this. (I guess I can't blame you for misunderstanding the commit message!)
Nick Gammon said:
Why do you call WindowCreate in a draw function?
Exactly as WillFa said, it's easier than maintaining a list of changes that have and have not been done, and whether or not to redo ones that belong "behind" the changes on the Z axis.
WillFa said:
OHHHHHHHH... I get it... You're never getting a cancelMouseOver because you're nuking the hotspot in the MouseOver.
Doh. That would explain a lot. This was more of a bug in the workings of the framework than MUSHclient, then. *cough*
Nick Gammon said:
As a workaround either don't re-create the window every time you want to draw in it (after all, then you have to re-add all hotspots, and you have other problems like the one this thread is about, and it is inefficient in that memory is being freed and then reallocated), or if you must have the creation code there, do a check first that the window does not already exist of the correct dimensions, and in the same place (in which case you can skip that line).
It's so much easier to just recreate and redraw, heheh. Hmm, this will require some thought.
Nick Gammon said:
BTW, you can avoid using the "self" parameter on function calls if you declare them a bit differently.
I'm aware, but I've read certain things about being efficient with tables, like declaring things in the table initializer {} rather than after-the-fact. I could probably do something like this, though... and it would be a rather C++-like approach. In fact I'm already doing it with the .new() functions *laughs*.
tbl = {
foo = nil,
bar = nil,
}
function tbl:foo()
end
function tbl:bar()
end
I'll probably change the code to do this. I've been juggling design and implementation decisions, though, so I didn't bother with a few things at first (like this).
WillFa said:
My changes are forked and uploaded, Twisol.
Thanks! I'll check them out, I really appreciate the assistance.
Nick Gammon said:
This saves coding "magic numbers" into your code.
I wasn't sure whether I could access error_code and the others without importing constants.lua first (which is really wrapped by XML). Now I see error_code is an entirely separate table, and it seems that I can access it, so thank you for letting me know!
EDIT: Will, your editor is trampling the extra indentation on blank lines. >_> You also might want to look here [1].
[1] http://help.github.com/dealing-with-lineendings/ |