Thread Tools Display Modes
07-19-07, 12:41 PM   #1
kamcknig
A Murloc Raider
Join Date: Jul 2007
Posts: 5
quick NOOB question

Hey everyone... I was just reading up on all the UI configuration stuff. I have looked over all that I thought I needed to make the most simple UI mods.

Here is what i have:

a HelloWorld.toc file containing:
Code:
##Interface: 20100
##Title: HelloWorld
##Notes: Nothing to special
HelloWorld.lua
HelloWorld.xml
a HelloWorld.lua file containing:
Code:
function HelloWorld()
    ShowUIPanel(HelloWorldFrame);
end
and a HelloWorld.xml file containing:
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">

    <Script file="HelloWorld.lua"/>
    <Frame name="HelloWorldFrame">
        <Scripts>
            <OnLoad>
                HelloWorld();
            </OnLoad>
        </Scripts>
        <Size><AbsDimension x="100" y="100"/></Size>
        <Anchors>
            <Anchor point="TOPLEFT"/>
        </Anchors>
    </Frame>
</Ui>
When I start up the game, i get an error something to the effect of "Interface\FrameXML\UIParent.lua:782: attempt to call method 'IsShown' (a nil value)"

I have no idea what this means. I am not a complete beginner in programming in general, but i am a beginner in lua and UI scripting. I found the line in the UIParent file, but it doesnt really help since I don't know WHY i'm getting that error. Is there anything wrong with my code?

Thanks!

P.S. I found out later, that I didnt need the quotations in the ShowUIPanel call in my HelloWorld.lua file... So I took those out. I no longer get the error, but the frame still is not shown.
  Reply With Quote
07-19-07, 01:42 PM   #2
Layrajha
A Frostmaul Preserver
 
Layrajha's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 275
There are two things I noticed in the code.

First, your frame isn't a "UIPanel". From what I know, UIPanels are some of the build-in frames, like the character, friends, honor, macros, spellbook etc ones. They are those who hide on "escape" and hide each other when you try to show more than two at once.
I might be mixing them, but anyway, to show a "non-special" frame, use FrameName:Show()

UIPanels being handled differently, I think that it's not strange to get an error, even if I haven't checked where exactly it comes from.


Also, the files in your .toc will both be loaded, in the order specified. So it will load your lua and your xml files. If you had the <script> tag in your xml file linking to the same lua file, the lua file will be loaded twice (edit: but it's not what can cause your error, it's just a little note aside).


2nd Edit:
I just pictured I didn't answer about why your frame isn't shown:
It probably is, it's just "empty" somehow. You should add textures or colors to it.
To do so, you have to add something like:
Code:
<Layers>
  <Layer level="ARTWORK">
    <Texture name="texture name 1" file="file location 1">
      < some fields (like anchor etc)/>
    </Texture>
    <Texture name="texture name 2" file="file location 2">
      < some fields />
    </Texture>
  </Layer>
</Layers>
Here is a good link for a list of most of the fields you can change: http://www.wowwiki.com/Widget_API

Edit: corrected the xml code a bit.

Last edited by Layrajha : 07-19-07 at 01:50 PM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » quick NOOB question


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