12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER12Interacting with WidgetsYou’ve already created the base frame <strong>for</strong> BagBuddy, <strong>and</strong> added graphics,text, <strong>and</strong> item buttons created using templates. However, other than thehighlight texture on the item buttons, the frames are entirely static <strong>and</strong> youcan’t really interact with them. In this chapter you learn about different types<strong>of</strong> frames, such as buttons, status bars, <strong>and</strong> edit boxes. Once you’ve creatednew frames, you learn how to add dynamic behavior to them.Each different type <strong>of</strong> frame widget in <strong>World</strong> <strong>of</strong> <strong>Warcraft</strong> has certain scriptsthat can be set to respond to changes. For example, a button can set an OnClickscripttoruncodewhenthebuttonisclicked,orOnEnter to do somethingwhen the mouse moves over the button. Other more complex widgets, such asedit boxes, allow you to respond to different types <strong>of</strong> key presses.This chapter is meant as an introduction to interacting with widgets; <strong>for</strong>a full listing <strong>of</strong> the available frame scripts <strong>and</strong> methods, please refer to theWidget <strong>Reference</strong> in Chapter 29.Making BagBuddy’s Buttons InteractiveThe most <strong>of</strong>ten used widget (other than the basic frame type) is a Button.Buttons are used all over the default user interface to accomplish differenttypes <strong>of</strong> tasks:Player, target, <strong>and</strong> other unit framesAction buttonsBuff <strong>and</strong> debuff icons207

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!