Thread Tools Display Modes
01-13-15, 07:46 AM   #1
Malsomnus
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Apr 2013
Posts: 203
Mystery of the Disappearing X

My add-on has this frame which has a little X in the corner to close it.
The frame shows automatically on login.
When I just login, everything's fine. When I /reload, however, the X does not show. It's there, it's clickable, it works, but it's invisible.
I can make it visible again by changing its text.
Does anybody have any idea what the hell?



Lua Code:
  1. f.btnX = CreateFrame ("EditBox", nil, f)
  2. f.btnX:SetPoint ("TOPRIGHT", f, "TOPRIGHT")
  3. f.btnX:SetSize (10,12)
  4. f.btnX:SetTextColor (1.0,0.77,0.27,1.0)
  5. f.btnX:SetTextInsets (0, 0, 2, 2)
  6. f.btnX:SetFont ("Fonts\\FRIZQT__.TTF", 11)
  7. f.btnX:SetAutoFocus (false)
  8. f.btnX:Disable ()
  9. f.btnX:SetText ('x')
  10. f.btnX:SetScript ("OnMouseDown", function (self, button)
  11.     f:Hide ()
  12. end)
__________________
SanityCheck - If you've ever said the words "Sorry, I forgot" then you need this add-on.

Remember, every time you post a comment on an add-on, a kitten gets its wings!
  Reply With Quote
01-13-15, 08:10 AM   #2
sirann
A Flamescale Wyrmkin
Join Date: Mar 2007
Posts: 142
f:Show() before the onclick? also what's f.btnX: Disable()?
  Reply With Quote
01-13-15, 08:14 AM   #3
Malsomnus
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Apr 2013
Posts: 203
It's pretty old recycled code, but IIRC I'm using an EditBox instead of, err, anything that makes sense, because I used to have problems with the click events, and Disable just means it's not used as an actual text box that you can focus and edit.
And :Show doesn't help, since technically it is already shown.

[Edit]
I've replaced it with a proper button for now just so I can push a new version, but I'm still curious about what caused this problem.
__________________
SanityCheck - If you've ever said the words "Sorry, I forgot" then you need this add-on.

Remember, every time you post a comment on an add-on, a kitten gets its wings!

Last edited by Malsomnus : 01-13-15 at 09:09 AM.
  Reply With Quote
01-13-15, 04:01 PM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Sounds like its frame level is below some other texture on your frame?

Could just be covered up.

Alternatively, since it's an edit box your text may just be getting cleared.

Last edited by semlar : 01-13-15 at 04:03 PM.
  Reply With Quote
01-13-15, 05:50 PM   #5
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
I came to this thread expecting a thrilling Twilight_Zone story about the "Mystery of the Disappearing X". And now this. How disappointing.
  Reply With Quote
01-13-15, 08:00 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Wait, wait, wait... Why are you using an editbox to close your frame?

/edit: okay, so I read the rest of the thread. But my mind was totally blown by ^^^ that I couldn't focus on anything afterward.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Mystery of the Disappearing X


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off