WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Trouble displaying 2 buttons. (https://www.wowinterface.com/forums/showthread.php?t=57733)

wildcat69 12-13-19 11:43 PM

Trouble displaying 2 buttons.
 
EDIT: I fixed it thanks to @Fizzlemizz, you rock!

I am struggling displaying 2 buttons in the same frame. I am following Mayron's videos and am unable to add a 2nd button to my frame following his code.

I am attaching my code at the end of this message. Here is the video I am following.

Any help would be very much appreciated, I was flying through his videos until this. I can get everything working but displaying the 2nd 'reset' button

Thank you!

Code:

local UIConfig = CreateFrame("Frame", "MUI_BuffFrame", UIParent, "BasicFrameTemplateWithInset");

UIConfig:SetSize(300, 360); --width, height
UIConfig:SetPoint("CENTER", UIParent, "CENTER"); --point, relativeframe, relativepoint, xoffset, yoffset



--Child frames and regions
UIConfig.title = UIConfig:CreateFontString(nil, "OVERLAY");
UIConfig.title:SetFontObject("GameFontHighlight");
UIConfig.title:SetPoint("LEFT", UIConfig.TitleBg, "LEFT", 5, 0)
UIConfig.title:SetText("WildCat Addon");

--BUTTONS!!!
--UI Save Button
UIConfig.saveButton = CreateFrame("Button", nil, UIConfig, "GameMenuButtonTemplate");
UIConfig.saveButton:SetPoint("TOP", UIConfig, "TOP", 0, -70);
UIConfig.saveButton:SetSize(140, 40);
UIConfig.saveButton:SetText("Save"); --directly communicates to the buttons main FontString object
UIConfig.saveButton:SetNormalFontObject("GameFontNormalLarge");
UIConfig.saveButton:SetHighlighFontObject("GameFontHighlightLarge");



--UI RESET BUTTON

UIConfig.resetBtn = CreateFrame("Button", nil, UIConfig, "GameMenuButtonTemplate");
UIConfig.resetBtn:SetPoint("TOP", UIConfig.saveButton, "BOTTOM", 0, -10);
UIConfig.resetBtn:SetSize(140, 40);
UIConfig.resetBtn:SetText("Reset");
UIConfig.resetBtn:SetNormalFontObject("GameFontNormalLarge");
UIConfig.resetBtn:SetHighlighFontObject("GameFontHighlightLarge");


Fizzlemizz 12-14-19 12:43 AM

Install BugGrabber and BugSack to show the errors you're getting.

Comment out the two lines with "SetHighlighFontObject"

Errors happen in order so your first button shows before hitting the first error. Then everything stops.

wildcat69 12-14-19 12:34 PM

Quote:

Originally Posted by Fizzlemizz (Post 334776)
Install BugGrabber and BugSack to show the errors you're getting.

Comment out the two lines with "SetHighlighFontObject"

Errors happen in order so your first button shows before hitting the first error. Then everything stops.

Thanks for the tip on those 2 addons.

I did exactly what you said and it started working! Stupid me said "SetHighlighFontObject" instead of "SetHighlightFontObject" and it bombed it.

Also thank you for the tip about everything stopping when I hit an error. good to know! I am new :p

This question is answered! Thank you so much! Amazing community


All times are GMT -6. The time now is 07:35 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI