Quantcast Trouble displaying 2 buttons. - WoWInterface
Thread Tools Display Modes
12-13-19, 11:43 PM   #1
wildcat69
A Defias Bandit
Join Date: Dec 2019
Posts: 2
Question 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");

Last edited by wildcat69 : 12-14-19 at 12:35 PM.
  Reply With Quote
12-14-19, 12:43 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,154
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-14-19 at 01:03 AM.
  Reply With Quote
12-14-19, 12:34 PM   #3
wildcat69
A Defias Bandit
Join Date: Dec 2019
Posts: 2
Thumbs up

Originally Posted by Fizzlemizz View Post
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

This question is answered! Thank you so much! Amazing community
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Trouble displaying 2 buttons.

Thread Tools
Display Modes

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