Thread Tools Display Modes
01-23-07, 06:04 AM   #1
Silmano
A Murloc Raider
 
Silmano's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 9
Strange button/layer problem

I have a button in XML with the following code:
Code:
<Frames>
      <Button text="Sell" name="SellButton">
        <Size>
          <AbsDimension x="100" y="22" />
        </Size>
		<Layers>
			<Layer level="BACKGROUND">
				<FontString name="$parentSubText" inherits="GameFontNormalSmall" justifyH="LEFT"/>
			</Layer>
		</Layers>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="0" y="0" />
            </Offset>
          </Anchor>
        </Anchors>
        <Scripts>
			<OnLoad>this:SetFrameLevel(this:GetFrameLevel() + 1);</OnLoad>
          <OnClick>SOM:Sell()</OnClick>
        </Scripts>
        <NormalTexture file="Interface\Buttons\UI-Panel-Button-Up">
          <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
        </NormalTexture>
        <PushedTexture file="Interface\Buttons\UI-Panel-Button-Down">
          <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
        </PushedTexture>
        <DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
          <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
        </DisabledTexture>
        <HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD">
          <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
        </HighlightTexture>
        <ButtonText name="$parentText">
          <FontHeight>
            <AbsValue val="10" />
          </FontHeight>
        </ButtonText>
        <NormalFont inherits="GameFontNormal" font="Fonts\FRIZQT__.TTF">
          <FontHeight>
            <AbsValue val="12" />
          </FontHeight>
          <Color r="1" g="0.8196079" b="0" />
          <Shadow>
            <Color r="0" g="0" b="0" />
            <Offset>
              <AbsDimension x="1" y="-1" />
            </Offset>
          </Shadow>
        </NormalFont>
        <HighlightFont inherits="GameFontHighlight" font="Fonts\FRIZQT__.TTF">
          <FontHeight>
            <AbsValue val="12" />
          </FontHeight>
          <Color r="1" g="1" b="1" />
          <Shadow>
            <Color r="0" g="0" b="0" />
            <Offset>
              <AbsDimension x="1" y="-1" />
            </Offset>
          </Shadow>
        </HighlightFont>
        <DisabledFont inherits="GameFontDisable" font="Fonts\FRIZQT__.TTF">
          <FontHeight>
            <AbsValue val="12" />
          </FontHeight>
          <Color r="0.4980392" g="0.4980392" b="0.4980392" />
          <Shadow>
            <Color r="0" g="0" b="0" />
            <Offset>
              <AbsDimension x="1" y="-1" />
            </Offset>
          </Shadow>
        </DisabledFont>
        <PushedTextOffset x="0" y="0" />
      </Button>
    </Frames>
When I first load the button it all goes well:

Button shows in the correct layer, its clickable and it calls the function when I click on it.

If I close the merchant window and reopened any other time, I find this:

Button is in the same layer, but merchant frame is now 5 layers above! So I cant see nor click on the button.

For showing/hiding the button I use the functions show() & hide().

Any clue on what can I do to solve this?
  Reply With Quote
03-22-07, 08:52 AM   #2
Synthos
A Deviate Faerie Dragon
Join Date: Mar 2007
Posts: 10
try using Frame:Raise() when the merchant frame is shown.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Strange button/layer problem


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