0:00:14 | hope you can all you me it's not that you know and peace to free |
---|
0:00:18 | to interrupted anytimes and questions |
---|
0:00:21 | so the topic is G T K propagation developers and |
---|
0:00:26 | i've |
---|
0:00:27 | but not us but it's an abstract that wasn't really clear on what i was |
---|
0:00:30 | going to do so well actually sit down to write prepared this talk i figured |
---|
0:00:34 | and i want to try and just show some examples of what's possible this project |
---|
0:00:38 | a K and i hope i can convey these examples that it's actually it's really |
---|
0:00:42 | easy not to build country style applications as we expect them to be that they |
---|
0:00:47 | had about that's |
---|
0:00:48 | nicely nice transitions and all that stuff that you see in blocks and rather than |
---|
0:00:52 | and these applications |
---|
0:00:53 | this is dedicated point and |
---|
0:00:56 | but most of the building block so that are in place and |
---|
0:01:00 | it doesn't take that much work to get something like that off the ground |
---|
0:01:04 | and i will show that in the series of examples |
---|
0:01:08 | then i had his nine steps |
---|
0:01:10 | yesterday's on going to show nine example sell forget so the |
---|
0:01:14 | and at the end i will have something that looks a bit like an application |
---|
0:01:17 | just really limited but that's something |
---|
0:01:20 | hopefully inspiring and i did not prepare a slide so this instead i decided i |
---|
0:01:26 | want this material to be available for the longer term so i will call as |
---|
0:01:31 | actually wanna but examples they all available in the did okay so three itself sometime |
---|
0:01:36 | last week |
---|
0:01:38 | and that extra rolled around it is it's all available in the G D K |
---|
0:01:42 | A P I documentation you have a tutorial section there and you check that right |
---|
0:01:46 | so you can look on it up online if you want |
---|
0:01:50 | it's available that solve |
---|
0:01:53 | last week |
---|
0:01:54 | and we'll see how well it actually works for talk it's an experiment so let |
---|
0:01:58 | me know if it doesn't work more than five to do something else |
---|
0:02:01 | so but before we step into the examples maybe it's were stepping back a little |
---|
0:02:05 | bit and ask what actually is an application we learned from that out yesterday |
---|
0:02:11 | how we things an application to look at the star trek future it's all the |
---|
0:02:14 | single bundle that you can just download and run it without installation it will be |
---|
0:02:18 | very cool but that's not quite where we are today so as of today applications |
---|
0:02:23 | that have a number of things that need to be spread around to five system |
---|
0:02:27 | and i just put up the list the of the things that are they obviously |
---|
0:02:31 | it's the application binary itself expected will use a bit |
---|
0:02:36 | then applications need to have a testify that's pretty from the established that the show |
---|
0:02:40 | can actually displayed nicely and it also needs and i can for that obviously |
---|
0:02:45 | and then every nontrivial applications will have some settings and for that we need a |
---|
0:02:50 | setting schema and then they might be just a miscellaneous other resources like you i |
---|
0:02:55 | files and whatnot |
---|
0:02:57 | which you would ordinarily also spatter on the five system |
---|
0:03:01 | but we actually have resources nowadays if you pay attention to the examples to see |
---|
0:03:05 | that we actually get to put all those other resources inside the binary itself so |
---|
0:03:10 | that's all already a pretty good step towards the |
---|
0:03:13 | single file application future |
---|
0:03:16 | that we want to get to |
---|
0:03:18 | and don't here i'll talk a little bit about all the stuff that i'm hoping |
---|
0:03:23 | to touch on the examples |
---|
0:03:25 | i'm not gonna we the whole list here you can see this stuff to go |
---|
0:03:29 | to so let's get to it |
---|
0:03:32 | in stockholm building up a vacation |
---|
0:03:35 | so the first thing to know about they don't want to use jic application here |
---|
0:03:40 | which is the application class that you can provide so that yes |
---|
0:03:44 | yes i know i just wanted to have the idea one line main functions like |
---|
0:03:50 | i was willing to like except that league |
---|
0:03:58 | so let's not go to too much on that the one thing to take away |
---|
0:04:00 | he is that the main function is really not ready action is it's just the |
---|
0:04:04 | one line that the really just creates an instance of obligation class and then we |
---|
0:04:09 | college application on it and to give at the command of parameters minutes it |
---|
0:04:13 | not much else to that's all the all the logic of application and all the |
---|
0:04:17 | ending of command line options and all that is happening in the application class |
---|
0:04:22 | so one and a little bit us a very trivial application classes we do some |
---|
0:04:28 | plastic application for that that's the intended way of using it |
---|
0:04:32 | and we used to the usual G object want to pay for that we don't |
---|
0:04:37 | really implement anything here yet |
---|
0:04:40 | just december entry points to applications this for instance if you just run the application |
---|
0:04:45 | all about them not giving it any arguments then we have an entry point it's |
---|
0:04:50 | called active at a |
---|
0:04:53 | which is what is called when you in then you just run it by itself |
---|
0:04:57 | and i have a kind of trivial application at implementation of that here which just |
---|
0:05:02 | creates a new window and then presented |
---|
0:05:05 | the entry point that i have implemented years opening files |
---|
0:05:10 | so if you run the application and give it file filenames on the command line |
---|
0:05:14 | well colour different into point it's called open and that gets an array of files |
---|
0:05:20 | and in this implementation here not much is happening we just |
---|
0:05:23 | again we created i would know and then we call this |
---|
0:05:27 | open function for each of the files and |
---|
0:05:30 | magic might happen the functional not |
---|
0:05:33 | and that's about it one thing to maybe briefly possible look at is |
---|
0:05:38 | that creating an application |
---|
0:05:41 | subclass you always want to have an application id that's kind important because that's really |
---|
0:05:46 | very central concept in the board of the application you really want to have an |
---|
0:05:49 | application id which is used as the last name and it seems just of ideally |
---|
0:05:53 | you system in for the best of file and all those things so we need |
---|
0:05:56 | a unique identifier for the implication |
---|
0:05:59 | and that's this idea here |
---|
0:06:03 | that's not a of this fairly trivial skeleton implementation is that just saw for that |
---|
0:06:09 | at some places i created windows |
---|
0:06:13 | and those and those are actually instances of this class example up a little |
---|
0:06:19 | which is a subclass of G T K application bundle and |
---|
0:06:23 | again this is an entirely empty imitation does nothing but than necessary scalable is a |
---|
0:06:28 | so it's a question like the last slide would be one line and it's this |
---|
0:06:32 | main what do you can tax you bind text domain is that handled for you |
---|
0:06:37 | and you have to shine directly or should and i mean as well i only |
---|
0:06:40 | glanced over that here but i guess you would have to do some setup work |
---|
0:06:43 | for that and okay so you do that automatically there's no magic that's just a |
---|
0:06:47 | matter don't know okay |
---|
0:06:50 | maybe my dad that if you to i don't know that |
---|
0:06:54 | so maybe things are changing that offer knowledgeable if you wanted internationalisation you have to |
---|
0:06:58 | set that up |
---|
0:07:00 | okay |
---|
0:07:02 | last thing that i have in this initial example is that we also one and |
---|
0:07:07 | i can attest of file up is the created some |
---|
0:07:11 | model like i can dare think the game for five minutes |
---|
0:07:15 | and |
---|
0:07:17 | the decibel it after five years also very couple of i just put an ad |
---|
0:07:21 | in the idea |
---|
0:07:23 | just to cheat a little bit because i'm running one able runs that location in |
---|
0:07:27 | a minute and i'm actually running it uninstalled so i have to actually catch to |
---|
0:07:31 | like being here |
---|
0:07:33 | to make that work |
---|
0:07:36 | and we actually switch to |
---|
0:07:39 | running his example |
---|
0:07:44 | should also take first |
---|
0:07:47 | this is inside the G T K so it is an examples directory and if |
---|
0:07:51 | you look and that |
---|
0:07:52 | this nine subdirectories which contain examples and i'm going to here |
---|
0:07:57 | and right now i'm stepping into the first one |
---|
0:08:02 | and it's already component are running it |
---|
0:08:06 | who this my educational it's not very exciting admittedly |
---|
0:08:10 | doesn't really contain anything it doesn't even will the title |
---|
0:08:13 | but |
---|
0:08:15 | notice that the channel already picks up the it has some five |
---|
0:08:19 | and find see i can we just because i she did a little bit and |
---|
0:08:22 | put the i can in the whole local share i can somewhere and up to |
---|
0:08:26 | justify there's also just that this works you |
---|
0:08:30 | and realised of course it's all these files and user share somewhere |
---|
0:08:35 | have it worked that way |
---|
0:08:37 | so it's not very impressive but admittedly we didn't write much good either and |
---|
0:08:43 | well there's not much to see this already |
---|
0:08:46 | it's a football geolocation which has a presence on the bus a single instance |
---|
0:08:51 | characteristics |
---|
0:08:53 | and it technically also kind of file so right now i just activated that are |
---|
0:08:57 | running it without arguments but it could give it a |
---|
0:09:01 | an argument like this |
---|
0:09:04 | well nothing else happens because we'd have implemented the open function yet but at least |
---|
0:09:07 | it accepts the adamant |
---|
0:09:10 | and things are set up for the next |
---|
0:09:15 | so step to is |
---|
0:09:17 | this winter was twenty so yes |
---|
0:09:22 | it's annoying isn't |
---|
0:09:24 | so they're not here |
---|
0:09:27 | and then for that |
---|
0:09:28 | okay so i'm next that is still |
---|
0:09:32 | get some content and the window so that we are using something that if you |
---|
0:09:36 | went to just on stock just before lunch you probably talked about ten that's |
---|
0:09:41 | maybe you didn't did you |
---|
0:09:43 | okay so we're using complex this is all just on that in the last year |
---|
0:09:47 | or two and it finally landed in G T K |
---|
0:09:50 | so what's attempted is likely you i follicles want to use to editing that's great |
---|
0:09:55 | operating late |
---|
0:09:57 | and |
---|
0:09:59 | just like that you can see the beginning of the file |
---|
0:10:02 | the my main difference between that and the directional you i find is that attempted |
---|
0:10:05 | actually define say it complex which is like a container with internal structure |
---|
0:10:10 | and you can use clay for populating that instead of having to manually writing in |
---|
0:10:13 | that function that that's G T K contain i had of this G T K |
---|
0:10:17 | box next out of that and handily really write a lot of code for populating |
---|
0:10:22 | your constructed your complex you are you can one adding like know which is really |
---|
0:10:27 | pretty nice |
---|
0:10:28 | and so he is our initial and that |
---|
0:10:32 | you can see we have a defining the example happen a class that i showed |
---|
0:10:36 | earlier |
---|
0:10:38 | maybe just pack a few things in the first of all we set some useful |
---|
0:10:41 | properties like to be no title and the people size |
---|
0:10:45 | maybe put in the box and they have the populate the box that i had |
---|
0:10:48 | about a stack |
---|
0:10:50 | you can stick and didn't and inside the had about we have a stack switching |
---|
0:10:55 | and i see these which it and actually in a minute |
---|
0:10:59 | but first able to stop briefly and show how we actually get to use this |
---|
0:11:03 | template so now we just click on the set |
---|
0:11:05 | you i file |
---|
0:11:07 | and |
---|
0:11:09 | to make use of it for actually defining application middle class we because a function |
---|
0:11:13 | called G T K widget class set template from resource |
---|
0:11:18 | which finds this templates |
---|
0:11:20 | to our |
---|
0:11:21 | or subclass |
---|
0:11:23 | and i talk about the results that in a minute bottom that's the first step |
---|
0:11:27 | the other step is that then we actually instantiate this class integrated application the know |
---|
0:11:32 | in the in a function for that we have to called you can project in |
---|
0:11:36 | the template actually use the template and populate our instance |
---|
0:11:43 | it's a two steps for using attempted |
---|
0:11:45 | and i touched on that earlier be using resources |
---|
0:11:50 | and |
---|
0:11:51 | that means that we actually take this window dot U I for the to the |
---|
0:11:56 | national italian fee turn it into a |
---|
0:12:00 | resource hundred happy then link into our education binary |
---|
0:12:04 | that's done using the tool called |
---|
0:12:07 | gina compile resources and do the proper resources takes |
---|
0:12:11 | it's input like we tell it what actually to compile into that resource bundle by |
---|
0:12:16 | but in this little excellence that up there |
---|
0:12:19 | and i'm not gonna get too much into it if you want to really look |
---|
0:12:22 | into that you can check out examples |
---|
0:12:25 | in the repository that's all hooked up with the makefile you can see actually running |
---|
0:12:30 | looking let me switch back to actually running this example now |
---|
0:12:35 | so we are stop to |
---|
0:12:38 | and i'm running it again |
---|
0:12:41 | but |
---|
0:12:42 | as you can see the windows not entirely empty at this point you have |
---|
0:12:46 | obviously we have the window title and if you if you look at the top |
---|
0:12:49 | of them and you can kind of see the and you had about their which |
---|
0:12:54 | it's not really prominent of the that's gonna get populated in the next steps |
---|
0:12:58 | well no this is just basis for the work |
---|
0:13:07 | okay so that's me is |
---|
0:13:09 | we want to actually populate the speculated that we put in place an ultimate upon |
---|
0:13:15 | that out and we want to |
---|
0:13:18 | i to act what you know if you can are already passed financial the command |
---|
0:13:21 | line so the next have a step we actually want to open these files and |
---|
0:13:25 | children |
---|
0:13:26 | for that |
---|
0:13:30 | because if you know features that want to mention |
---|
0:13:34 | all example brno class now case a private start |
---|
0:13:40 | you can see to find out there that contains just one on i'm not currently |
---|
0:13:44 | this stack pointer there |
---|
0:13:47 | and there's a new way actually just change recently you the way it used to |
---|
0:13:51 | be for private starts that you use to call |
---|
0:13:54 | G type class at try that in your class in a function and we turned |
---|
0:14:00 | that around to cycle and we actually made that more declarative so now the new |
---|
0:14:04 | way of doing this is that you use G define typhus private and that that's |
---|
0:14:08 | automatically on seems |
---|
0:14:10 | we don't have to do anything anymore in your class function for this |
---|
0:14:14 | and it is that you can do something else in your class in a function |
---|
0:14:16 | which is |
---|
0:14:18 | well you can use |
---|
0:14:20 | this somewhat magic thing here called G T K widget last |
---|
0:14:24 | find template right private that's quite a most well i think that's the content of |
---|
0:14:27 | a long as function name and G T K |
---|
0:14:32 | i couldn't really how it need to be that long to fit all the naming |
---|
0:14:35 | patterns and everything else so what does this do |
---|
0:14:39 | just for the should things behind the scene so we give it the example happened |
---|
0:14:43 | or name |
---|
0:14:45 | and we give it a name of variables that there and |
---|
0:14:48 | what's happening behind the scene is that this instructs you to create a |
---|
0:14:54 | because to use the private various function it knows that it actually is supposed to |
---|
0:14:58 | look in the private struck that's also associated press example happen all so example up |
---|
0:15:02 | in the private |
---|
0:15:04 | and |
---|
0:15:05 | should look for this stack member in it |
---|
0:15:08 | and it showed populate definitely |
---|
0:15:11 | that which it from the template that escorts that |
---|
0:15:14 | so this is one of the magic not at actual this that when we get |
---|
0:15:17 | to a instance and it function we can rely on the fact that the |
---|
0:15:21 | the staff member in our private structures is pointing to the better that we want |
---|
0:15:25 | to point to |
---|
0:15:26 | so there's not a lot of hassle manually look and also |
---|
0:15:33 | i don't know that's a question from under |
---|
0:15:38 | okay so this was just preparatory work for actually |
---|
0:15:44 | doing some actual logic here i'm not gonna explain this in detail |
---|
0:15:48 | this is the code to create a store dwindle great attacks to inside it and |
---|
0:15:53 | open the file that was passed as an argument |
---|
0:15:56 | and populate the text to with the contents of that file |
---|
0:15:59 | one thing that's worth pointing out us some venom at all this a line the |
---|
0:16:03 | record it a stack at titled |
---|
0:16:06 | that is very actually at the |
---|
0:16:08 | this more brno S A H in our state so to speak |
---|
0:16:12 | and |
---|
0:16:14 | we give it very unique identifier for that we just use the basin of the |
---|
0:16:17 | file and then there's another argument which is |
---|
0:16:21 | did a display title to actually show in the you know i will see that |
---|
0:16:25 | the be obvious one so run it |
---|
0:16:29 | and the other one thing i want to say about that is that the display |
---|
0:16:34 | type is obviously going to be displayed but this text which i would just the |
---|
0:16:37 | rolls of caps |
---|
0:16:39 | but we don't have to touch this text which at all you because |
---|
0:16:42 | this text which are just getting all this data needs to know how many types |
---|
0:16:46 | display able to show and then by looking at the at the stack that is |
---|
0:16:50 | associated with |
---|
0:16:58 | so the problem |
---|
0:17:01 | so i'm switching back to running as well |
---|
0:17:06 | well that's magic now we actually have contended it looks like a real application of |
---|
0:17:09 | so let me make is a little bit and actually given files |
---|
0:17:27 | i don't know that's a question for the design as i think i mean i |
---|
0:17:30 | think about available for this case |
---|
0:17:32 | and |
---|
0:17:34 | i would i'm sure the designers would do time we often find something wrong about |
---|
0:17:39 | it works so |
---|
0:17:42 | good things to say it is that you see this text which are now that's |
---|
0:17:46 | the like the two buttons updated |
---|
0:17:48 | those get created but it's text which are |
---|
0:17:51 | and you know the |
---|
0:17:53 | the content of the file at U C obviously council |
---|
0:17:57 | from the function i just showed you and we can |
---|
0:18:00 | actually switch between them and it works so that that's you can stack and you |
---|
0:18:03 | can stick switcher |
---|
0:18:05 | connection |
---|
0:18:13 | i just keep moving on is this questions feel free to interrupt me at any |
---|
0:18:17 | time |
---|
0:18:19 | next this we want to resolve a little more that an application menu i don't |
---|
0:18:22 | need to say too much evolved modification men us and how it works |
---|
0:18:26 | well dive right into how you do this |
---|
0:18:30 | and also get specified by educator that you iphone |
---|
0:18:34 | like this one here |
---|
0:18:37 | and i don't think i should say too much and details about the syntax you |
---|
0:18:41 | can see that we actually created menu element which is a menu not surprisingly and |
---|
0:18:46 | they can be sections in there |
---|
0:18:48 | and items and the items have |
---|
0:18:51 | a couple of at a good see a we set a label which is what's |
---|
0:18:54 | gonna going to shop in the U I |
---|
0:18:57 | and then we have an action for each item |
---|
0:19:00 | which is what's going to get activated and you have to check on that menu |
---|
0:19:03 | item |
---|
0:19:05 | and actually used is you i for an obligation we need to call G T |
---|
0:19:11 | K application setup menu |
---|
0:19:14 | and a good place to do that is in the startup before |
---|
0:19:19 | of your energy application |
---|
0:19:21 | i mentioned earlier that you application as a number of different entry points like it |
---|
0:19:24 | has an active right does it open or you could activated by directly calling in |
---|
0:19:28 | action |
---|
0:19:29 | and how you activated how you started there's always a startup different that it gets |
---|
0:19:35 | caught no matter what |
---|
0:19:37 | so that's a good place to do things that you want to happen in all |
---|
0:19:40 | the cases |
---|
0:19:41 | because if you have to actually |
---|
0:19:44 | get a lot |
---|
0:19:46 | you are funded i just so |
---|
0:19:48 | and then we |
---|
0:19:50 | well you get the menu model |
---|
0:19:52 | that the data constructed format and we called you get jic application setup menu |
---|
0:19:57 | which does all the work behind the scenes just this puts us stuff on the |
---|
0:20:01 | bus on the session but also the show picks it up from there so that's |
---|
0:20:04 | a lot of things that are happening behind the scenes of that's right |
---|
0:20:12 | right i did not really get into the difference between finer primary and secondary instance |
---|
0:20:16 | but you're so right points out that G application as this concept of single instance |
---|
0:20:21 | which are briefly mentioned earlier and that means there's a primary instance which is actually |
---|
0:20:27 | fourty flash running application and if you start again on the command line it's not |
---|
0:20:32 | gonna open set second binary but just |
---|
0:20:34 | talk to the primary instance |
---|
0:20:36 | and the startup function i said it gets run no matter what it only gets |
---|
0:20:40 | run in the province but if you're if you're starting at or second time and |
---|
0:20:43 | doesn't actually launch something them started with not |
---|
0:20:51 | okay that's a fair point |
---|
0:20:54 | going back to this i said earlier in a financial to you have a if |
---|
0:20:58 | you to be mention applications like each item as an associated action |
---|
0:21:02 | and so we need to somehow bring these actions into |
---|
0:21:05 | into being and that's what what's happening actually four lines up here |
---|
0:21:10 | we call a function called G action map at actually entries |
---|
0:21:15 | which is |
---|
0:21:17 | also a lot of work that's happening by the scenes that school of a little |
---|
0:21:20 | bit |
---|
0:21:21 | you can actually see the add entries irate if you pass in there |
---|
0:21:25 | this looks very similar to what we what we have and how to indicate for |
---|
0:21:28 | the longest time which is a G T K action entry every |
---|
0:21:33 | and this is just basically the same kind of idea translated into G action sort |
---|
0:21:38 | of detection |
---|
0:21:41 | so we are creating to actions one is as the name preferences minus on this |
---|
0:21:44 | and it could |
---|
0:21:46 | just a student to do that you saw the U I five before |
---|
0:21:49 | and we have you be also specify the activate callbacks you like could activated it's |
---|
0:21:54 | called in the collection is activated preferences activated escort |
---|
0:21:58 | when preferences you preference actions activated |
---|
0:22:03 | that's actually try that out |
---|
0:22:07 | so not to step for |
---|
0:22:12 | that you have to have an |
---|
0:22:14 | vision and you know yes it's there so the shell has successfully picked up |
---|
0:22:20 | menu the other people on the bus |
---|
0:22:22 | and that S which it shows of the preferences and could menu item |
---|
0:22:27 | no one click on preferences |
---|
0:22:30 | nothing happens that's because the preferences activity function that i just is percent these of |
---|
0:22:34 | us nothing |
---|
0:22:36 | exciting is going on but it is fully functional |
---|
0:22:40 | just works and a little bit want to show that |
---|
0:22:44 | you may not more may not what is it but for the for the could |
---|
0:22:47 | i don't actually specified a keyboard accelerator people talk out in the U I for |
---|
0:22:53 | the expected one controlled you |
---|
0:22:55 | and when i had control to here |
---|
0:22:57 | also works or that is already hooked up |
---|
0:23:01 | and the next that will be to make the preferences menu item actually something |
---|
0:23:06 | well that i'm moving on to the next step |
---|
0:23:10 | which is |
---|
0:23:12 | soon so how preferences work |
---|
0:23:14 | and |
---|
0:23:17 | we want our preferences obviously to be remembered from one run of the application for |
---|
0:23:21 | the next are we gonna use G settings to number them |
---|
0:23:25 | and for using G settings the first step is always to that you need a |
---|
0:23:30 | schema for a settings |
---|
0:23:32 | which is another type of X M L file actually here |
---|
0:23:35 | is fairly minimal scheme are just system to settings and it the one is |
---|
0:23:39 | a font the unless a transition time |
---|
0:23:45 | there's some magic that you need to do some magic intent incantations that you need |
---|
0:23:49 | to do to make it make use of the scheme or you have to compile |
---|
0:23:53 | it but you have to like |
---|
0:23:55 | installed icexml from the right location and then you call gina comply schemas to |
---|
0:24:01 | it's gotta be have some autoconf |
---|
0:24:04 | macros to make that |
---|
0:24:06 | the little easier if you're using all the tools |
---|
0:24:09 | so i'm not gonna dive into the details of how to do that let's just |
---|
0:24:11 | assume |
---|
0:24:12 | that we can figure that out |
---|
0:24:15 | and so now we have a disk in that case |
---|
0:24:19 | which means you can actually now use our settings and for that |
---|
0:24:24 | we need to quality settings new to obtain an instance of our settings |
---|
0:24:29 | object |
---|
0:24:31 | and |
---|
0:24:33 | the next thing we do is we use a very convenient functionality of T settings |
---|
0:24:36 | which is finding |
---|
0:24:38 | so we have this settings here actually earlier which is about the other which was |
---|
0:24:43 | called transition |
---|
0:24:44 | and we just find that too |
---|
0:24:47 | remember pressed accuracy |
---|
0:24:49 | it's a pointer that points to the do you can stack which is that we |
---|
0:24:54 | have in our window somewhere |
---|
0:24:57 | and the do you can stack it's a property that's called transition type |
---|
0:25:02 | and i would just by deciding to the |
---|
0:25:04 | to the property |
---|
0:25:06 | and that's all we need to do to make the reject reactor the changes of |
---|
0:25:10 | the setting |
---|
0:25:18 | there's some educated and i'm not gonna get into right now |
---|
0:25:22 | it's even better than |
---|
0:25:23 | then i'm telling |
---|
0:25:24 | so let's |
---|
0:25:30 | let's see if i can actually because |
---|
0:25:33 | so remember we don't have a preference dialogue get that we have hooked up to |
---|
0:25:37 | setting service |
---|
0:25:38 | going to see and if i can actually |
---|
0:25:42 | prove to you that if i don't change the settings |
---|
0:25:46 | on the command line using the G settings commitment to |
---|
0:25:51 | i hope that something is |
---|
0:25:53 | as i mean i was gonna less impressive that wanted because the window was hidden |
---|
0:25:56 | but you can see that the |
---|
0:25:58 | the application actually picked up my phone so strange before was one space to open |
---|
0:26:02 | autumn especially |
---|
0:26:05 | but obviously using the command line for these kind of changes it's not ideal so |
---|
0:26:08 | we want to |
---|
0:26:09 | a preference dialogue so that that's move on and constructive |
---|
0:26:17 | obviously be we use all the same things that we've already used to be again |
---|
0:26:21 | right attempted five for this dialogue this time it's a |
---|
0:26:25 | it's a subclass of you could dialogue can see appear |
---|
0:26:29 | and i'm not gonna go to listen detail but you can see that we populated |
---|
0:26:32 | that they |
---|
0:26:34 | some labels and the data from that they're gonna use for the phone probably obviously |
---|
0:26:39 | and the little further down |
---|
0:26:42 | is a combo box that using for the this transition property which is three possible |
---|
0:26:46 | values |
---|
0:26:48 | and i'm specifying them right in the in the template |
---|
0:26:56 | and then |
---|
0:26:59 | you obviously a great a subclass of ticket dialogue for this |
---|
0:27:02 | using the standard |
---|
0:27:04 | so there's all the same one i played and i showed you for our occasional |
---|
0:27:08 | you find type of private that business |
---|
0:27:11 | and we do the same tended finding that we did for vacation and when this |
---|
0:27:17 | time you do it for a preference dialogue |
---|
0:27:21 | we again obtain an instance of our settings you |
---|
0:27:25 | percent X |
---|
0:27:27 | and again we use the settings finding functionality combine |
---|
0:27:31 | or settings this time to bite into the controls we have in the dialogue actually |
---|
0:27:37 | the changing |
---|
0:27:38 | so for the for the font setting the use the |
---|
0:27:41 | the functional |
---|
0:27:43 | and for the position settings use this combo box |
---|
0:27:47 | i didn't actually pointed out that the name of that budget in the time that |
---|
0:27:50 | five was position |
---|
0:27:54 | and |
---|
0:27:56 | there's a lot more part of it here |
---|
0:27:59 | on think we still have to do is |
---|
0:28:01 | we created this preferences activated callback for the action but it was empty so we |
---|
0:28:05 | know need to go back to it and |
---|
0:28:08 | make it actually created you instance of a preference dialogue and present that |
---|
0:28:16 | and |
---|
0:28:17 | so let's go back and see how that looks |
---|
0:28:30 | you can see of all font settings change from last one got remembered across to |
---|
0:28:35 | be stuff |
---|
0:28:36 | and |
---|
0:28:37 | no tricking preferences again and a test our preference that'll and it has the things |
---|
0:28:42 | that i pointed out earlier in the that so there's a one choose a |
---|
0:28:46 | chose the value that we just sat in the on the command line |
---|
0:28:50 | and that's the combo box for the transition |
---|
0:28:53 | just gonna briefly pause and show what it actually does |
---|
0:28:57 | change the slide |
---|
0:28:59 | and if i know change taps here |
---|
0:29:03 | actually any mates so this is a new feature indicates that |
---|
0:29:06 | as opposed to the old do you can notebook |
---|
0:29:09 | you can actually do nice animated transitions here the other one that i have it |
---|
0:29:13 | here in the preference dialogue i'm gonna show that as well as the cross fade |
---|
0:29:18 | so for change to that then |
---|
0:29:20 | you can kind of see the cross fade happening here |
---|
0:29:23 | so that's a nice new feature of you can stack which is made possible by |
---|
0:29:27 | all the frame based drawing like that owned it the last year |
---|
0:29:35 | okay well known |
---|
0:29:39 | this application starting to look like an application that's fairly minimal so will add a |
---|
0:29:43 | few more bits of functionality here |
---|
0:29:46 | the next that is very common and don't see application research that's obviously very central |
---|
0:29:50 | so i want to show how to make be |
---|
0:29:54 | research entry here that looks somewhat similar to what we have another one applications |
---|
0:29:59 | product we the use do you can search entry which is just a subclass of |
---|
0:30:04 | do you can feel it has a bit of extra functionality |
---|
0:30:08 | to make a certain like basically a button and it has see extra signal that |
---|
0:30:11 | kind of patches the changes things like that and then we used to do concerts |
---|
0:30:15 | but i would just and you a budget |
---|
0:30:18 | which lets you |
---|
0:30:20 | place such country and maybe some other divided you might need and content in relation |
---|
0:30:24 | to that |
---|
0:30:25 | in inside a |
---|
0:30:27 | toolbar model stick and slide in from the top |
---|
0:30:31 | let's see how we actually use those |
---|
0:30:35 | so they go back to our |
---|
0:30:38 | have that for application than or |
---|
0:30:40 | and the and if you extra things |
---|
0:30:44 | right we had a probable so they had a bar |
---|
0:30:48 | the be much easier to see that men i run the application and i'm just |
---|
0:30:50 | pointing out how this looks and they |
---|
0:30:52 | covered |
---|
0:30:56 | and |
---|
0:30:58 | no further down |
---|
0:31:00 | between the had about the stack you know put a search by |
---|
0:31:04 | the search but contains a search entry |
---|
0:31:07 | and |
---|
0:31:08 | what we also do here is |
---|
0:31:10 | we hook up this segment of for the search changed signal of the searching for |
---|
0:31:14 | you might you know that have that right so we don't have too many legal |
---|
0:31:17 | ninety six not connect to know |
---|
0:31:19 | so once again this reduces |
---|
0:31:22 | the amount of menu cool to have to be produced |
---|
0:31:26 | and obviously implementing search actually takes quite a bit of work i'm not gonna go |
---|
0:31:31 | to that in detail here but i just wanted to |
---|
0:31:34 | if you show that there see the main did to be for this work us |
---|
0:31:38 | having a second like he has touched exchange which gets called |
---|
0:31:43 | whenever you talk a new character in your surgery |
---|
0:31:47 | and then we would do magic was text you just to find the first match |
---|
0:31:50 | for that you know text |
---|
0:31:52 | and |
---|
0:31:54 | one vector |
---|
0:31:56 | like a couple again |
---|
0:32:02 | so it is well you can see the |
---|
0:32:05 | there's of like on is that all the button that i mentioned |
---|
0:32:08 | if i click that's |
---|
0:32:12 | so sparse lights in the such entry |
---|
0:32:15 | and i can type something like |
---|
0:32:21 | so just |
---|
0:32:22 | that's kinda need |
---|
0:32:26 | escape i think |
---|
0:32:29 | okay |
---|
0:32:31 | so |
---|
0:32:33 | that's already pretty good |
---|
0:32:36 | but you can at the present a little more functionality you before but i'm not |
---|
0:32:39 | so |
---|
0:32:41 | think it's a step eight of nine so i might actually gets too much steps |
---|
0:32:44 | supposed to learn that |
---|
0:32:47 | sidebar |
---|
0:32:50 | i really have to like wracked my brain to come up is some example that |
---|
0:32:55 | lets me put in as many of the new but just as possible so i |
---|
0:32:58 | cannot this let me let me know that that's totally ridiculous but at least it |
---|
0:33:03 | gets the don't drop down definitional do you can menu button did you can reveal |
---|
0:33:07 | and you can just box set |
---|
0:33:10 | so once again we |
---|
0:33:12 | go back into our tempted |
---|
0:33:14 | and we are just sort you that we added top to bottom |
---|
0:33:18 | we know at a menu button next to that that's down here you can menu |
---|
0:33:22 | button |
---|
0:33:26 | and then going for the down |
---|
0:33:28 | and maybe used to have the G T K stack |
---|
0:33:31 | we know |
---|
0:33:32 | wrap that inside you get box and |
---|
0:33:35 | put a |
---|
0:33:37 | a little extra |
---|
0:33:38 | before it is actually i was audible so we put something left |
---|
0:33:42 | which is a G T K with you know that contains a list box in |
---|
0:33:45 | the school window |
---|
0:33:49 | and |
---|
0:33:52 | it's a little more xml here to show |
---|
0:33:56 | i said that i put a menu button there i didn't actually tell you where |
---|
0:33:59 | the menus coming from that's yet another |
---|
0:34:02 | the U I for that actually here |
---|
0:34:04 | which is really virtually identical to the syntax of the one that i showed you |
---|
0:34:09 | polyak menu it's just another |
---|
0:34:11 | you i five to be find a gym anymore |
---|
0:34:14 | in this case i just put a single item in there right now |
---|
0:34:18 | just a label words and they know the action here words |
---|
0:34:23 | and obviously i need to tell you where that actually comes from |
---|
0:34:27 | so we go back to this is actually to go back you can |
---|
0:34:32 | i so i called action show works but actually the U I five says when |
---|
0:34:36 | dot show words |
---|
0:34:38 | the window hottest this goebbels the action so the actions we saw before for the |
---|
0:34:42 | application manoeuvre applications goal actions which we defined in |
---|
0:34:47 | in the startup function of the application |
---|
0:34:50 | but there can also be we know school actions |
---|
0:34:53 | and the can i mention here is that you refer to those by putting went |
---|
0:34:57 | off as the prefix the name |
---|
0:35:00 | and obviously in brno school action should not be defined in the G application startup |
---|
0:35:05 | function but it should be specific to the rental so we at that action in |
---|
0:35:09 | the in the function of our example than a class |
---|
0:35:13 | and the last three lines that actually but it happens |
---|
0:35:17 | in this case we use a settings actually |
---|
0:35:22 | which is a neat little this integrate to take one of audio settings |
---|
0:35:27 | in this case it's setting called sure words and just wrap actually and actually wanted |
---|
0:35:33 | and |
---|
0:35:35 | activating the action will have that we change the value of the setting |
---|
0:35:40 | this case the setting this is leon and |
---|
0:35:45 | the settings action who just probably and every time you activated |
---|
0:35:49 | that's a very convenient way to make settings available to the you live in the |
---|
0:35:53 | form of actions |
---|
0:35:56 | and but that i'm switching back to show you know that looks |
---|
0:36:06 | okay so |
---|
0:36:08 | next a lot of the button up there |
---|
0:36:10 | is to get something you know |
---|
0:36:13 | menu button |
---|
0:36:15 | click connect |
---|
0:36:16 | is the menu item that i just |
---|
0:36:18 | mystified |
---|
0:36:19 | and if i actually |
---|
0:36:21 | product |
---|
0:36:23 | decide partials up and you saw that it actually slides and that's what the really |
---|
0:36:27 | knows doing it cannot that's the animated |
---|
0:36:30 | reveal |
---|
0:36:31 | and inside they really lazy |
---|
0:36:35 | in this box here this block so i could can spend an entire talked us |
---|
0:36:38 | talking about do you can this box and what that's about it doesn't do but |
---|
0:36:42 | it is essentially it's just a container that is |
---|
0:36:45 | it's meant to contain lots of digits and it has |
---|
0:36:48 | functionality that you normally associate with the but that review like it can filter can |
---|
0:36:53 | consult the items that are contained in it |
---|
0:36:56 | but the to the defining difference between this and the triggers that |
---|
0:37:01 | it shows actually is that which it it's not a seven day which is kind |
---|
0:37:05 | of a different layout model so this is nice if you want to have a |
---|
0:37:08 | list |
---|
0:37:09 | but you want to have actual july and it's not necessarily just data-driven |
---|
0:37:14 | giant data is |
---|
0:37:16 | and since i have to come up to something for this example adjust |
---|
0:37:19 | created buttons one button for each button my text and if i click on one |
---|
0:37:23 | of those buttons |
---|
0:37:25 | research again so this december |
---|
0:37:28 | make this example but meaningful |
---|
0:37:37 | right |
---|
0:37:40 | and i just saw the movie to hide itself again |
---|
0:37:43 | so we don't |
---|
0:37:46 | almost and this is the last step |
---|
0:37:48 | but i've been about them of this like first it had only it's that's actually |
---|
0:37:51 | and then ryan came back to me and said okay just reason like probably actions |
---|
0:37:57 | because that's need to so i went back and i racked my brain a little |
---|
0:38:01 | more and try to come up with some way of showing property actions |
---|
0:38:05 | so what what's that about |
---|
0:38:09 | which is all and a topic so if you have lots of useful properties and |
---|
0:38:13 | it's a it's a said earlier these settings action but it just showed it's a |
---|
0:38:16 | very convenient way to make settings accessible to do you want to from corrections |
---|
0:38:21 | and there similarly G property action does the same thing for properties of widget object |
---|
0:38:29 | and |
---|
0:38:30 | we'll see how that works |
---|
0:38:33 | so i'm not going in all the details here but just explaining what what's happening |
---|
0:38:38 | here we have seen to have to go back to our camp that again and |
---|
0:38:41 | be i'm adding a two labels |
---|
0:38:43 | pulled out of our |
---|
0:38:45 | the names are lines label lines actually get again just talk about it and then |
---|
0:38:52 | we go to our |
---|
0:38:54 | the U I for it defines the geeky a menu |
---|
0:38:57 | and be out at the second item there |
---|
0:39:00 | the name lines and |
---|
0:39:02 | but they are the new action show lines |
---|
0:39:05 | which now would be a property action |
---|
0:39:08 | so i have to show you know that is done |
---|
0:39:11 | and again it's done in the in a function of all in the class and |
---|
0:39:15 | it is the first line there's |
---|
0:39:17 | G property actually you so we specify the name show lines and then we |
---|
0:39:23 | we use the lines object |
---|
0:39:24 | and you probably expect by now that pretty lines is another |
---|
0:39:29 | point a very banal prime instructed gets magically populated finally |
---|
0:39:34 | gee wouldn't you can window class pine temperature a lot well |
---|
0:39:38 | so that's for that one little that we just added |
---|
0:39:42 | and use the visible property of the label and we have another boolean target actually |
---|
0:39:47 | here |
---|
0:39:48 | and |
---|
0:39:50 | yet another thing that i squeezed in this last that is that |
---|
0:39:54 | but only can be do that but we can also |
---|
0:39:58 | use |
---|
0:39:59 | object binding here logistic in a nice way to basically connect properties of different objects |
---|
0:40:05 | and keep them and so |
---|
0:40:07 | so that's what we're using here to assess at the at to labels but we |
---|
0:40:10 | always want them to become visible invisible together so we can adjust we use do |
---|
0:40:16 | you object buying property to just connect the visible property of these two widgets |
---|
0:40:21 | so when i when i show the first one the second one automatically get shown |
---|
0:40:24 | as well |
---|
0:40:29 | let me show you look something about it yes |
---|
0:40:54 | okay so |
---|
0:40:56 | rest of them here's our new menu item lines i just quit that |
---|
0:41:00 | metropolis |
---|
0:41:02 | to label simply here |
---|
0:41:04 | and show you the code for actually counting the lines the text |
---|
0:41:07 | as well that that's interesting to taps |
---|
0:41:11 | it actually a baseline count you |
---|
0:41:14 | and if i top and the property again |
---|
0:41:18 | most of them disappeared the same time because that was the properties are all together |
---|
0:41:24 | and |
---|
0:41:26 | that was the last step so i'm actually |
---|
0:41:30 | and on the my samples |
---|
0:41:32 | i'll be and what that and if you have any questions free to ask |
---|
0:41:35 | thanks to take a break from this i hope are but it's actually really not |
---|
0:41:40 | hard automatic norm three style vacation using |
---|
0:41:43 | bits and pieces that are available in typically master now so it's tickets we can |
---|
0:41:47 | all of this would be |
---|
0:41:49 | would be at your disposal and |
---|
0:41:52 | actually did a line count you on the last step you that most complete example |
---|
0:41:56 | that i have comes onto some five hundred lines of C code and some two |
---|
0:42:00 | hundred lines of you across |
---|
0:42:03 | so that's not too bad considering it see |
---|
0:42:09 | no i that i used to be a for this |
---|
0:42:13 | but i hope late what we have to it as well that's just |
---|
0:42:18 | yes |
---|
0:42:26 | can repeat the question mark |
---|
0:42:30 | okay |
---|
0:42:31 | yes this first of all as i said earlier these examples including all the makefile |
---|
0:42:38 | integration everything is available the G T K source tree so you can go then |
---|
0:42:42 | local actually that this that's make for the yams |
---|
0:42:46 | there's also a various documentation for instance the i pointed out at some point is |
---|
0:42:51 | that we should some macros in G I L actually for the for the schema |
---|
0:42:55 | compilation part and there's a link that's of the G I O documentation but that's |
---|
0:42:59 | explain |
---|
0:43:00 | and |
---|
0:43:01 | maybe have documentation for some for the resource part of so an actual about that |
---|
0:43:07 | okay so some of this might not be wrapped a nice macros |
---|
0:43:11 | but some of it is and for the parts that are there should be documentation |
---|
0:43:15 | somewhere inside the G I O documentation but that's not necessarily easy to find so |
---|
0:43:20 | i try to put links to that in this |
---|
0:43:29 | right that's a that's a good exactly actually |
---|
0:43:33 | so there's a there's a nice you way of writing documentation hold how do i |
---|
0:43:37 | that wind kicked off and this drumming |
---|
0:43:40 | drumming for which |
---|
0:43:44 | that that's available i think it's a one about resources maybe not yet but |
---|
0:43:48 | we should make one available |
---|
0:43:55 | so there's more questions or nothing i want to say is that this is the |
---|
0:43:59 | location where you can actually find all of all of this online this is the |
---|
0:44:03 | D A P I documentation where |
---|
0:44:05 | that i just wanted to other point out that i found a few box and |
---|
0:44:09 | in the documentation gonna bend over this last night so but i showed you was |
---|
0:44:13 | my local fixed build and that will be all our online but the next you |
---|
0:44:18 | can release |
---|
0:44:19 | and this is a the G T K sources and you can see the night |
---|
0:44:23 | subdirectories where i ran |
---|
0:44:25 | these examples |
---|
0:44:31 | thank you next time |
---|
0:44:36 | and questions |
---|
0:44:39 | okay thank you |
---|