View Single Post
04-15-05, 09:23 PM   #5
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
I'm no expert but I believe you want:

Code:
<Frame name="MyScriptOptionsFrame">
    <Frames>
	<Button name="MyScriptOptionsButton" hidden="false">
		<Size>
			<AbsDimension x="19" y="19" />
		</Size>
		<Anchors>
			<Anchor point="TOPLEFT" relativePoint="BOTTOMRIGHT">
				<Offset>
					<AbsDimension x="1" y="1" />
				</Offset>
			</Anchor>
		</Anchors>
		<Scripts>
			<OnLoad>
				this.tooltip = "Configure My Script";
			</OnLoad>
			<OnEnter>
				GameTooltip:SetOwner(this, "ANCHOR_LEFT");
				GameTooltip:SetText(this.tooltip);
			</OnEnter>
			<OnLeave>
				GameTooltip:Hide();
			</OnLeave>
		</Scripts>
	</Button>
    </Frames>
</Frame>
The button will also be invisible until you give it textures:

Code:
<Frame name="MyScriptOptionsFrame">
    <Frames>
	<Button name="MyScriptOptionsButton" hidden="false">
		<Size>
			<AbsDimension x="19" y="19" />
		</Size>
		<Anchors>
			<Anchor point="TOPLEFT" relativePoint="BOTTOMRIGHT">
				<Offset>
					<AbsDimension x="1" y="1" />
				</Offset>
			</Anchor>
		</Anchors>
		<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
		<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
		<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
		<Scripts>
			<OnLoad>
				this.tooltip = "Configure My Script";
			</OnLoad>
			<OnEnter>
				GameTooltip:SetOwner(this, "ANCHOR_LEFT");
				GameTooltip:SetText(this.tooltip);
			</OnEnter>
			<OnLeave>
				GameTooltip:Hide();
			</OnLeave>
		</Scripts>
	</Button>
    </Frames>
</Frame>
I use the CheckBox textures only as an example. You would want to use a Checkbutton instead of Button to make a checkbutton control. Lots of stuff built in. If you want just a red standard button:

<NormalTexture file="Interface\Buttons\UI-DialogBox-Button-Up"/>
<PushedTexture file="Interface\Buttons\UI-DialogBox-Button-Down"/>
<HighlightTexture file="Interface\Buttons\UI-DialogBox-Button-Highlight" alphaMode="ADD"/>

If you want to make a button with text on it, you can inherit the GameMenuButtonTemplate (there are others, but I'm new to this too lol)

Code:
<Frame name="MyScriptOptionsFrame">
    <Frames>
	<Button name="MyScriptOptionsButton" inherits="GameMenuButtonTemplate" text="Options">
		<Size>
			<AbsDimension x="70" y="19" />
		</Size>
		<Anchors>
			<Anchor point="TOPLEFT" relativePoint="BOTTOMRIGHT">
				<Offset>
					<AbsDimension x="1" y="1" />
				</Offset>
			</Anchor>
		</Anchors>
		<Scripts>
			<OnLoad>
				this.tooltip = "Configure My Script";
			</OnLoad>
			<OnEnter>
				GameTooltip:SetOwner(this, "ANCHOR_LEFT");
				GameTooltip:SetText(this.tooltip);
			</OnEnter>
			<OnLeave>
				GameTooltip:Hide();
			</OnLeave>
		</Scripts>
	</Button>
    </Frames>
</Frame>
(changed x size to 70 so the word is readable)
  Reply With Quote