View Single Post
02-24-19, 02:12 PM   #1
wille480
A Wyrmkin Dreamwalker
Join Date: Jan 2017
Posts: 56
Target subframe within main frame

Hello! So i am wondering how i can target the subframe that lies within a mainframe? I am making a group box sort of where the main window is just the window where the group members lies inside.

This is how it looks: https://gyazo.com/1bf04b61fb48f560429fadf1f944f10e

How can i target the frame with the name "Lwarlock"?


How my code is built
Lua Code:
  1. local mainWindow = CreateFrame("Frame", "DragFrame", UIParent) -- The main window (Orange color)
  2.    
  3.     local subFrame = CreateFrame("Frame", "SUBFRAME", UIParent)
  4.     local texture = subFrame:CreateTexture("ARTWORK")
  5.     local fontString = subFrame:CreateFontString(nil. "OVERLAY", "GameFontNormal")
  6.  
  7.     subFrame:SetPoint("TOP", mainWindow, "TOP", 0,0)

A general way how the code looks. That is the way i add the subframe to the main frame anyways. Sub frames are going to be added and removed left and right in this program so this is why i cant use a frame:SetScript("OnMouseDown") event. That is what i think atleast, i have this subframe creation code inside a function that will be called pretty often so! Any tips? Kind Regards

Last edited by wille480 : 02-24-19 at 02:17 PM.
  Reply With Quote