WoWInterface (
-   Lua/XML Help (
-   -   Radio button like table? (

Layback_ 12-26-17 08:20 PM

Radio button like table?
Hi again all,

Hope everyone had a great Christmas and having a great end of years holiday!!!

So, lets say we have three radio buttons and they are in a same group. As we all know, selecting either of them will deselect the rest and vice versa. My question is if there is a such kind of table function built in Lua which sets the rest to false apart from the one that user has chosen, or should I just create one myself with metatable thing?

Thank you in advance :D

Fizzlemizz 12-26-17 08:34 PM

If you look at the Garrison UI for the recruiter in your Garrison Inn (if you have one), Blizzard version of a radio uses CheckButtons and:


function GarrisonRecruiterType_OnClick( self )
        local frame = GarrisonRecruiterFrame.Pick;
        if( self:GetID() == 1 ) then

So, nothing "native".

There is the UIRadioButtonTemplate for creating the "dot" button.

MunkDev 12-26-17 08:38 PM

I usually put every checkbutton in a table and then use something like this as a general OnClick script:
Lua Code:
  1. local function CheckOnClick(self)
  2.     for _, button in ipairs(self.siblings) do
  3.         button:SetChecked(false)
  4.     end
  5.     self:SetChecked(true)
  6. end

Layback_ 12-26-17 09:01 PM

Thank you Fizzlemizz and MunkDev!

Guess I'll have to create my own version of it, then :D

Again, hope you guys have a great end of year's holidays :banana:

Fizzlemizz 12-26-17 09:11 PM

The more common in-game "default" for a radio type action would be the scroll or drop(scroll).

You have a great New Years also :banana:

All times are GMT -6. The time now is 07:04 AM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI