Hello, in this programming video, we are going to take a look at adding a radio button to our Python application. So the first thing we want to do is to VA equal interval. On each radio button that we have, the variable that we're going to assign to it is going to be a number. If you wanted a string, I would just change this, but we're just keeping it simple. And what we're going to do is if you click a particular radio button, it will trigger a method that we're going to create that will override label that will be creating as well and it was a you clicked essentially, you know this particular radio button so you know 1234 and do you like so. Now for the radio, I turn the radio on.
Radio, window text Equals option once a radio button the difference between that and a checkbox is only one radio would be selected at a time. So if I A if all sort of scenario where as with a checkbox, you can select multiple outcomes option one. Variable equals value equals one, man equals select. So this command is what we're actually going to be implementing which we haven't implemented yet and we will be implementing it very soon. So, what is radio wonder pack and W, so W, W is West, so if you know west or east and the reason why anchoring is Because when we click on it, a label will be overridden text will be put inside of it, but that will actually make the window wider. And if we don't anchor the radio button, what happened is that has been the center of the window, you might want that if you do, then just get rid of that.
If you don't then anchor it this way, they're always on the left, if you always want them you know, Easter watch, and so I put in stead. So what I'm going to do, I'll make full screen for now, because I'm going to keep it simple enough. Four radio buttons are basically the same. Just a slight difference 234 this should be displayed next to it provides the user information with what the clicking values are generally different. You could have the same but they should be different. Now what we're going to do is Label Label window.
Label that pack. Finally, we need to actually implement this select methods after we can do before the window. You don't need to access the window to death and all these crazy selection and this is awesome option. I will concatenate the variable so this right here, the wall dot get. And so what we're doing is we're when it gets clicked, it will be put into here and from here, we can practice that need to convert to a string to concatenate? Thank you label dot config.
And in the config we have the second text. Save that. Let's run it. Okay, no errors, no errors if I click this one, as he sees it also option 123 and four. Let me just demonstrate this. So if I were to put e4 for this one, by default, it looks the same for click here.
As you can see, this one's been anchored to the right now aka east and but obviously the functionality is still the same. So that's it for a radio button selection widget. If you have any questions, feel free to reach out. Along with this video. Like every other widget tutorial, there will be a link that will provide all of the different functions and functionality that you can use to further enhance your widget. And if you have any questions feel free to reach And I'll assist you.
If not, I'll see you in the next awesome video.