Reply
Thread Tools Display Modes
Unread 11-05-11, 07:27 PM   #1
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 123
Addon to change the parent frame.

I use Move Anything which allows me to change the anchor frame for new frames created for my UI, but is there an addon that allows me to change the parent frame?

Any help on this would be greatly appreciated.

Thanks
__________________
__________________
Aanson is offline   Reply With Quote
Unread 11-05-11, 08:30 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 9,564
No, not that I know of... What exactly are you trying to accomplish?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

Seerah is offline   Reply With Quote
Unread 11-06-11, 12:10 AM   #3
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 123
Originally Posted by Seerah View Post
No, not that I know of... What exactly are you trying to accomplish?
Thanks very much for your response

I'm building my own interface and there have been a couple of times where it would be very handy.

A good example is for a button to appear next to AuctionFrame when I open the Auction House. A macro allowing me to accept the "Buyout action?" popup box would be added to this button, and it would be bound to middle mouse button click.

I also use the same mouse button for combat, and for other actions while not in combat and not viewing the auction house.

Everything is in place already. The only hurdle that I've encountered is not being able to have the button only show when AuctionFrame is up.

Ultimately, I need to be able to assign parent frames to my new frames rather than them just being the default 'UIParent'.

Any help you could give with this would be great. Thanks again for taking the time out.
__________________
__________________
Aanson is offline   Reply With Quote
Unread 11-06-11, 01:56 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 9,564
Wait, so are these buttons/frames that you are creating yourself? Or part of the default UI? Or...

If you're making them yourself, just use the parent frame you desire rather than UIParent when doing CreateFrame().

Otherwise, you can also use frame:SetParent("parent")
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

Seerah is offline   Reply With Quote
Unread 11-06-11, 05:39 PM   #5
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 123
Originally Posted by Seerah View Post
Otherwise, you can also use frame:SetParent("parent")
God no, I'm not an addon author by any means. Apologies if I gave that impression!

I have got pretty good at manipulating the UI using addons like MoveAnything and kgPanels etc though.

I use an action bar addon called Macaroon (which is incredible).

I've created a new bar with 1 standard button on it. Ultimately, all I'd like to do is change it's parent frame.

Do you think I'd be able to go into the .lua and change it there using the above line of code that you kindly suggested? If so, is it important at what point in the existing button code I slot it in?

Now that I think about it, it must already be parented to UIParent surely. I'll have a go at finding the appropriate line of code.

Thanks again for your time so far and wish me luck!!! (Bet I end up breaking something lol)
__________________
__________________
Aanson is offline   Reply With Quote
Unread 11-06-11, 05:41 PM   #6
Lily.Petal
A Molten Giant
 
Lily.Petal's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2010
Posts: 537
Link in my sig gives a easy-to-use Lua based addon that does this~ Thanks to Nib ;D

All you do is copy the example, and /fstack the frame you want to move, and then put it in and change where you want to put it. Nice and easy~

Called Lua Based UI Hider, it hides things as well as moving them, and only hides/moves what you want to. (two different example lines to show you how)
__________________

Aggro Color to KG Panels Borders - Nibelheim
Lua Based UI Hider - Nibelheim
Custom LUA PowerText - Stuf - Nibelheim, Seerah
Lily.Petal is offline   Reply With Quote
Unread 11-06-11, 06:18 PM   #7
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 123
Originally Posted by Lily.Petal View Post
Link in my sig gives a easy-to-use Lua based addon that does this~ Thanks to Nib ;D

All you do is copy the example, and /fstack the frame you want to move, and then put it in and change where you want to put it. Nice and easy~

Called Lua Based UI Hider, it hides things as well as moving them, and only hides/moves what you want to. (two different example lines to show you how)
I had a good look at the examples in the forum that your link takes me to. I couldn't for the life of me find the addon you were referring to though sorry!

The code in your posts looks a little like what I'm after, but I'd not have the faintest idea where to put it or what to do with it lol!!

Thanks for the suggestion
__________________
__________________
Aanson is offline   Reply With Quote
Unread 11-06-11, 06:36 PM   #8
Nibelheim
local roygbi-
 
Nibelheim's Avatar
Featured
Join Date: Jan 2010
Posts: 1,502
Link

Just insert your frames at the top of Core.lua, you'll find it.
__________________
Nibelheim is offline   Reply With Quote
Unread 11-06-11, 08:18 PM   #9
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 123
Originally Posted by Nibelheim View Post
Link

Just insert your frames at the top of Core.lua, you'll find it.
I think what I need to do is change the .lua in the Macaroon addon (as the button i want to change the parent for is created by Macaroon).

I'm just not sure what code to use or where exactly to put it!

It would be amazing if you could give me an example of code and perhaps let me know where to put it. That way I'd have a template to work from for other UI changes.

Please let me know if there is any information that you need and thanks so much for taking the time out.

EDIT: God I'm an idiot. Just noticed that you'd given me the link for your addon! I've downloaded it and I'll check it out tomorrow after work. Thank you!
__________________
__________________

Last edited by Aanson : 11-06-11 at 08:21 PM. Reason: Didn't see the link for the addon at first!
Aanson is offline   Reply With Quote
Unread 11-08-11, 11:20 AM   #10
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 123
Originally Posted by Nibelheim View Post
Link

Just insert your frames at the top of Core.lua, you'll find it.
I'm not sure if I've done what you suggested correctly. I'd downloaded your addon, bumped the .toc and added the bit of code to the top like you said. I logged on but it didn't seem to change anything.

I'm pretty sure that there's a HUGE chance that I've either put it in the wrong place or done something else wrong!!!

Please help moi!!




PHP Code:
local MoveFrameList = {
    [
"MacaroonBars38"] = {parent MerchantFramepoint "CENTER"rpoint "CENTER"00scale 1},

local FM CreateFrame("Frame")
FM:RegisterEvent("PLAYER_LOGIN")

local _G _G

-- Frames to Move
local MoveFrameList 
= {
    [
"ExampleFrame"] = {parent nilpoint "CENTER"rpoint "CENTER"00scale 1},
    
}

-- 
Frames to Hide
local HideFrameList 
= {
    
"ExampleFrame",
    
}

-- 
Functions
FM
.HideAllFrames = function()
    for 
i,v in pairs(HideFrameList) do
        
local f _G[v]
        if 
f then
            f
:UnregisterAllEvents()
            
f:Hide()    
            
f.Show = function() end
        end
    end
end

FM
.MoveAllFrames = function()
    for 
i,v in pairs(MoveFrameList) do
        
local t MoveFrameList[i]
        
local f_G[i]
        if 
f then
            p 
t.parent and _G[t.parent] or f:GetParent()
            
f:ClearAllPoints()
            
f:SetPoint(t.pointpt.rpointt.xt.y)
            
f:SetScale(t.scale)
            
f.SetPoint = function() end
        end
    end
end

FM
:SetScript("OnEvent", function()
    
FM.MoveAllFrames()
    
FM.HideAllFrames()
end
__________________
__________________
Aanson is offline   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Addon to change the parent frame.

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