View Single Post
08-11-18, 10:05 PM   #2
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
Wowpedia has a good example on that.

https://wow.gamepedia.com/Creating_a_slash_command

Depending on which frame it is you're looking to toggle on and off, it should be as simple as adding if not frame:IsShown() then frame:Show() else frame:Hide() end in your handler function (replacing "frame" with the frame in question, of course.)

Not sure if :IsVisible() or :IsShown() would be preferable, you might have to experiment. Or someone probably knows. But since you'd be calling :Show() and :Hide() on that very same frame, :IsShown() should work fine.

Last edited by Ammako : 08-11-18 at 10:09 PM.
  Reply With Quote