FLTK Rust: 1.1.0, Opacity, MenuItem images, tooltips.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello welcome to an episode in the filthy k-west series in this episode uh i'll show you some new methods added in the 1.1 release such as the window set opacity so we have here the example from the hello button example from the repo so to set the opacity of the window you can just call wind set opacity which takes a float floating point number between one and zero one is fully opaque and zero is fully transparent so if we try for example 0.5 let's make it a bit larger we run this you can also query the opacity using the getter when dot opacity so now you can see it's a bit transparent another addition to this uh released as the menu item um the here for example let's get the editor example so in the editor uh the here we have a menu bar a system menu bar and the system menu bar basically can add these uh items and them and now you can get the index of any item you add so for example we get the index here and we can access the item later when we need to buy index here previously you had to get the item using the find item method and you would give it the same string of the item for example now you don't have to pass the string itself you can just use at and the index and this is the index and let's just add this the quit as before and this just changes the color of the label so this works as previously you can also add a label to the you can add an icon to the menu items so for example um here in the documentation of menu item you check the documentation for add label we use this specs map this is just a folder uh animation of a folder and just get the image and here just add the image just check that fix map or image is imported so we can just add it here you can use any image you can scale the image whatever you like so here get the small icon next to the uh the text so the add label call basically let's add image sorry takes the image and then this other parameter places it if it's true it places the image on the left side if it's false it places it on the right side so if we give it false so it's on the right side another addition um you can now get the concrete concrete type when you pass the method scroll bar or edge scroll bar to a scroll widget same for the table any table widget you can get the scroll bars instead of a uh a trait object now we have the opacity the ad image and we've seen the uh the index using menu add or menu and admit you can get you can set scaled images instead of having to scale the image beforehand and i just also wanted to show you another trick here so you've noticed that apple tk has this grayish color by default if you pass if you call get system colors this would just grab the defaults color for your system so you can see it's a bit more whitish and another thing i wanted to show you is that you might already know that you can add tool tips to any widgets so for example that button set tool tip and help for example and you can basically change aspects of the tooltip using the tooltip struct so if you pass the button here you can get the tool tip here if you want to change for example anything in the tooltips let's go to the docs you can change the delay the the color the font a lot of things in the tool tip itself the margins so for example let's change the color of the tooltip so this is in the miscellaneous the tooltip struct itself so i can just set color and this changes the color for all the tooltips of your application so let's say enums color red for example now you can see that the tooltip is red in color you can change the delay as well as we've seen so that was basically it for this video i hope you enjoyed thanks for watching bye
Info
Channel: Mo_Al_
Views: 239
Rating: 5 out of 5
Keywords: fltk, rust, programming, gui, tutorial
Id: 26LYjnSXQ1A
Channel Id: undefined
Length: 8min 3sec (483 seconds)
Published: Fri Jul 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.