 How's it going everybody welcome back to some more and pie screen tutorials and videos with the Python language In the last video we were looking at widgets and now we're actually gonna backtrack and look a little bit more at forms I know I'm kind of jumping around being weird all over the place with these concepts and things to learn But I hope it is building in your mind and you're kind of seeing how it all pieces together So I'm back on the documentation looking at the form objects that we were looking at before and now We'll actually take a look at some of the attributes and things that we can play with in our form object We'll actually try and extend the functionality looking at different kinds of forms And we'll play with some of the stuff that we can do here You'll notice that the forms have the following class attributes, so we can kind of change this stuff The default values that are initialized initially The will create a form that fills the whole screen and is displayed in the top left corner You can see the arguments pass in the constructor for more details on controlling the size of a form So let's play with the size first That'll be an interesting thing to do you'll notice that these arguments here that we can pass in the constructor You can adjust the size of the form either providing an absolute size with lines and columns Or a minimum size with minimum lines and minimum columns the default minimums 24 by 80 provide the standard size for a pretty standard terminal if you plan to if you plan your forms to fit within that size They should be viewed on almost all systems without the need to scroll the form Note that you can use absolute sizing in one direction in the minimum in another should you wish Okay, so if we wanted to specify what size they were and make it Static note that we aren't actually calling a real constructor for our form object We're passing into the ad form function in our app objects our application manager and application class, so All these things in here are where we actually pass in the arguments for our form constructor So let's say we wanted only lines to be ten. Let's say we only wanted ten lines. Actually before I do all that I'll save this as a new script zero six Thank you for reminding me guys. I know you got my back Okay, so now we'll have ten lines this time around. I'll run this code Python zero six and We got ten lines sweet How about we do it with columns we can specify columns can be Like 40 or something Now we got a smaller form a smaller window now notice it's still way up at the top left though What if we want to change the position? Now the documentation I've noticed I could be wrong here I may be very blind to it But I couldn't find a whole lot on changing the position of the form it goes into a bunch of stuff on changing the position of a widget Like every time I search for position it always tells me all yeah We can change the position of a widget, but it doesn't specify anything about a form So I kind of piece it together now it tells us we have these following class attributes and Show at x and show at y are assuming are what we need to change So I modified that in my code over in the create like initialize function and I set self dot show at show underscore at x and I set that equal to like 10 or something or or Let's say let's say 40 because we know we have a big a big screen So when I run this code nothing happens, and I couldn't figure out why So I actually did a little bit of an interesting thing here What I did was I I wanted to examine the variables that the form object has so what I did is I set the value of The title text like the text box that we've set up in our form that widget there And I set it to equal to string of the variables that are stored inside this object so that allowed me to kind of do some introspection and Look through all this all of these variables. Actually, it's it's pretty bad when I don't have the full screen. I'll actually Comment this out for now and then run the code So now you should be able to see a little bit more of the variables that we're looking at The home button unfortunately doesn't work, but it's way way back at the very very beginning of this So you'll have to take my word for it But that's how I kind of learned that okay this documentation Show at X and show at Y actually lowercase so show underscore at X Now it should work I'll add our smaller lines and smaller width and height right here And I'll actually remove this value But if you notice now when I run the code Hey, we're way over here. We moved the position because of our show at X variable I guess I will go to like 20 and then show at Y Can be like five So hey now we've moved the position and we've changed the size so that's kind of cool In case you want to play a little bit more with your forms So now let's move on to the other stuff Those are things that we can do of course to change the position of the size But there's a little bit more functionality that we can add to it notice It explains a little bit more about placing the widgets on the form since we've done this now It's okay for me to look at this stuff And actually show you some of it an interesting thing here Is that the position in the size of a widget are controlled by the widgets constructor? But there are hints that the form class provides if you don't override the position of the widget You might have saw when we were looking at the widget page in the documentation There was like set rel X and set rel Y It'll be planned according to the forms and next rel Y and next rel X Corresponding to your whatever so these attributes are increased automatically every time a widget is placed But if you if you increase it yourself You can leave spaces and gaps between where other widgets are placed So if I add a new widget, I'll change this to first name And I'll add a new one called Last name before I do that if I say self dot next rel Y plus equals one Now there's a little bit more space Check it out Now we can see there's last name and first name right up here, but had I not done that it would have only been Just one line separating the two of them and we can of course change this to anything we want We can say like three Go way back down there. We could do negative one and then we wouldn't change it at all. We'd like overwrite it Did I save it? No, okay So now First name and last name are in pretty much the same spot. I could say first name John Then if I arrow down Hammond It's like they're on top of each other The only the only thing that's gonna be visible is the one that's active the one that was most previously active Of course, you'd never really do that But I want to show you that you can the same thing works for next real X like if I bring this way over to Next relax normally isn't added to because you'll notice when we Didn't run it. It's in the same of course x direction. It hasn't moved horizontally But if I were to add to it and let's say five Coordinates over now. I've got an indent. I'm way over here So that's easy enough to learn right So next real X and next real Y are variables that you can play with and learn while editing and These are things that are This is a method that's called as the user moves between widgets You can override this if you want to and do some interesting things with it Adjusts widgets. There's another one you can read about. I probably won't touch that while waiting the same thing Keep press timeout. That's interesting. You can actually set up a timeout variable or a value and It goes hand-in-hand with while waiting. So if you're interested it, you can check out the examples or I mean, I don't know. I recommend you play with it Okay, this video is getting a lot longer than I expected. I think so actually I'll move on to the other types of forms The other forms of a form class that you can use in the next tutorial We'll get into action form and Split form and other cool stuff. So thank you guys for watching. I hope you enjoyed this one I know it's pretty simple just kind of rearranging and replacing where our forms are on the screen But for a user interface, I mean, hey, that's stuff's important, right? You're the designer All right. Thanks again. I'll see you in the next tutorial