Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-25-13, 05:01 AM   #1
Xienor
A Defias Bandit
 
Xienor's Avatar
Join Date: Jan 2013
Posts: 2
Wink Disappearing elements

Hello,
This is the first time I write in these forums .
So, yesterday I began writing my first addon. I feel like I'm doing some slow & steady progress.
However, there are a few things that I cannot understand. Can you help me? Here is my code:
Lua Code:
  1. local EventFrame = CreateFrame("Frame")
  2. Roller=LibStub("AceAddon-3.0"):NewAddon("Roller","AceConsole-3.0")
  3. local AceGUI = LibStub("AceGUI-3.0")
  4. Roller:Print("Version 0.1 succesfully loaded. Type '/roller' to bring up the UI")
  5. Roller:RegisterChatCommand("roller", "RollerClient")
  6. function Roller:RollerClient(input) --Roller Client UI section
  7.     print("Roller UI test")
  8.     local frame = AceGUI:Create("Frame") --Main Frame Definition
  9.     frame:SetTitle("Roller 0.1")
  10.     frame:SetStatusText("Type the emote in the box and  then press the button...")
  11.     frame:SetCallback("OnClose", function(widget) AceGUI:Release(widget) end)
  12.     frame:SetWidth(500)
  13.     frame:SetHeight(150)
  14.     frame:SetLayout("Flow")
  15.  
  16.     local emotebox = AceGUI:Create("EditBox") --Emote Input Box
  17.     emotebox:SetLabel("Action:")
  18.     emotebox:SetWidth(200)
  19.     --editbox:SetCallback("OnEnterPressed", function(widget, event, text) emoteText = text end)
  20. --[[Pseudocode
  21.     raid_leader=UnitName("RaidLeader")
  22.     local function whisper_roll(int_roll, leader_name)
  23.       whisper_roll(roll,raid_leader)
  24.       ChatFrame1:Type("../w.."RaidLeader".. .."roll)
  25.     end
  26. ]]--
  27.     frame:AddChild(emotebox)
  28.  
  29.     local roll = AceGUI:Create("Button") --"Roll" Button
  30.     roll:SetText("Roll!")
  31.     roll:SetWidth(200)
  32.     --roll:OnClick(print(emoteText))
  33.     frame:AddChild(roll)
  34.  
  35.     --local dice=AceGUI:Create("Icon") --Dice Icon
  36.     --dice:SetImage("Img/icon.png")
  37.     --dice:SetImageSize(32,32)
  38.     --frame:AddChild(dice)
  39. end
  40. Roller:RegisterChatCommand("rollgm","RollerGM")
  41. function Roller:RollerGM(input) --GM Options UI Definition
  42.     print("Roller GM Options UI test")
  43.     local GMframe = AceGUI:Create("Frame")
  44.     GMframe:SetTitle("Roller 0.1")
  45.     GMframe:SetHeight(250)
  46.     GMframe:SetStatusText("GM Options")
  47.    
  48.     local check1 = AceGUI:Create("CheckBox") --First Checkbox
  49.     GMframe:AddChild(check1)
  50.    
  51.     local head1 = AceGUI:Create("Heading") --Heading
  52.     --head1:SetText("Header")
  53.     GMframe:AddChild(head1)
  54.    
  55.     local drop1 = AceGUI:Create("Dropdown") --First Dropdown Box
  56.     --drop1.SetText("Setting")
  57.     GMframe:AddChild(drop1)
  58. end
What's wrong? Basically:
1. The Heading doesn't get added to the GMframe.
2. If I try to use the SetText function of the Dropdown, drop1 disappears.
3. The "Icon" object doesn't seem to work... the AceGUI documentation speaks of a generic "icon", I've tried using a 32x32 png image without transparencies AND setting the size manually. All what gets shown is a green box.

These are the errors I've stumbled upon so far... do you know what I've done wrong?
Also, is there any function that will send a whisper to a player?

Thanks in advance!
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Disappearing elements


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