0:00:10so first of all i'm supposed to say that i'm very disappointed that you started
0:00:15glottic without me
0:00:20i wish i had a lot more of screen shots and slides and stuff but
0:00:25well i have a enough material for the time and i wanted to make a
0:00:31longer history but
0:00:33the history would have taken up all the time anyway
0:00:36so
0:00:37the point of this slide is
0:00:42the point is to discuss a little bit what was the history of G T
0:00:46K A
0:00:48user interface programming paradigms over the last ten years or so
0:00:53before live blade or around when we had the blade then we had to well
0:00:59everybody was writing code by hand right
0:01:02but the plate was pretty early in the G T K history you had played
0:01:08first and the
0:01:12so a lot of people were writing code
0:01:15mixed in with the generated code that they
0:01:19build with collate so glade had only one feature
0:01:23to export which was to generate code in different languages and you would have
0:01:30you would have a whole application defined in an X M L file
0:01:35and one callbacks nazis just generated and people would just enter their cold
0:01:41it would be completely on maintainable
0:01:46so that's interesting fun fact is that the blade was created after delayed and it
0:01:53kind of just was a hijacking of directly project file format which was a really
0:01:58neat trick by change ten strange
0:02:01and since then we had since then we have the blade and
0:02:07back then
0:02:09it seemed that
0:02:11installing your user interface
0:02:14separately from your programming and allowing you to view your changes without compiling was all
0:02:21the rage i don't think we really care about that these days but that seems
0:02:25to have been all the rage back then
0:02:30right so back then how did we used to write code we could write modular
0:02:35code but it was not obvious
0:02:37i have a couple of code examples that i wanted to show
0:02:44and one of them was
0:02:48sh this is
0:02:51okay the this emacs is really huge on the screen but
0:02:57i seen a lot of code like this ten years ago basically you just create
0:03:02a structure and you build a lot of widgets and you have any pi its
0:03:07object based see it's not object oriented
0:03:11but you know people managed to and
0:03:16well maybe it's coming back now with templates you know this modular kind of way
0:03:20to write code but with late we just had a big mess
0:03:26huge user interface and many callbacks
0:03:30so just scroll through the well basically
0:03:36what's that
0:03:40so where
0:03:43okay so
0:03:46a eventually and my miss and my stepping over something after the blade
0:03:53after the blade well after the blade there was to take a builder but that
0:03:57came like five years later and
0:04:01and there is one interesting events that took place or event i started noticing the
0:04:09depth help program had bills itself as the G object for the preferences dialogue and
0:04:16use the G T K builder
0:04:18in the initialization function to create it's own interface and
0:04:24and it looks like a whole lot of boilerplate an extra lines of code like
0:04:29to do something pretty but it was it was actually really nicely done
0:04:33which is
0:04:34which is great you know and i started to encourage people to follow that paradigm
0:04:39but
0:04:41but people don't right
0:04:44people write the code that's obvious to them and if we don't guidelines
0:04:49and techniques and even
0:04:52infrastructure that forces you to code in a certain way then people are just going
0:04:56to write very random
0:04:58random things like for example
0:05:02how many times have you heard the question
0:05:06how do i get to pointers
0:05:09in my callback for G signal connect
0:05:13you know what i mean like that's like you're tackling the problem the problem from
0:05:18backwards you're not thinking of the design you just
0:05:21want this function to work right now what are you gonna do
0:05:25and
0:05:26how many people have seen cold like this
0:05:31like you have your callback structure you know
0:05:36and you allocate your callback structure
0:05:41you connected you have your data
0:05:45you know if you're lucky somebody thought of releasing the memory at some point
0:05:51and no but what it does to is that your dad is all over the
0:05:56place it's not centralised it's not it's not pretty it's not organised and
0:06:03and you're working in the environment that is
0:06:06errorprone because of the implicit invocation possibilities are enormous
0:06:12so you're working a project that's has all your dialogues all your buttons the same
0:06:19name space
0:06:22and anybody can just connect a signal
0:06:25and that can cause another signal to fire and there's no really defined limit since
0:06:31all of these objects are visible so you can have recursion and it's very hard
0:06:36to track these
0:06:37implicit invocation loops
0:06:46yes i'm not really jumping in order here but the whole generation
0:06:52i don't really have much to say about that but it's what everybody asks me
0:06:58why doesn't lead generate code
0:07:07yes
0:07:09yes maybe less in the last couple years but yes constantly
0:07:16ever since we released late three
0:07:19people cry about that
0:07:22yes like now i have to call
0:07:26glade X M L load from file do you take a builder add from file
0:07:31and
0:07:38well i mean that's the thing you know like it's
0:07:42your and you never gone and you never gonna use like twice if you're gonna
0:07:46use generated code just never gonna work out
0:07:51okay so
0:07:53after all that hey we have templates
0:07:57and not everybody knows what templates are but the templates are a way to encode
0:08:04G T katie builder X M L file descriptions into the widget class so that
0:08:09when you create an instance of a certain type
0:08:12it's complex it's components are automatically build and the variables referring to it are resolved
0:08:20and callbacks are connected
0:08:24it's just the formalism for creating and composite object class which we involves no grunt
0:08:31work
0:08:32there is a P eyes to call to describe it but there's no crunch work
0:08:36so not only do we gain
0:08:40by removing steps in the process of
0:08:43developing code but now we have a standard that's
0:08:46people can adapt to they can say this is the way that you write a
0:08:51composite widget in G T K and they they're not going to do this
0:08:57they're not going to ask how do i get to pointers in my user data
0:09:02they're not going to run around in circles and they're going to have a half
0:09:06in front of them
0:09:07alright
0:09:09a mean one
0:09:14so
0:09:17in this last ten years i guess ten years ago there was already this next
0:09:23that environment which was already doing this
0:09:26and little parenthesis here i
0:09:31i used interface builder and i used flash five years ago and that's when i
0:09:36started going crazy about templates and
0:09:40and it just like using X code in interface builder just
0:09:45just made me realise like
0:09:47how straightforward that is with G T K builder and
0:09:52kind of feeling pathetic about how come we did not do it yet and
0:09:57and it took this long here we are
0:10:00so next step environment is the apples objective C programming environment and name files is
0:10:09basically the equivalent of interface builders G T K builder format
0:10:15and they've been doing that for ever
0:10:18and they have some cool features to optimize your work flow so you can
0:10:26what are the features that they give you
0:10:29right you have those weird clients that's true you have the X code here and
0:10:34you have interface builder here and i wanted to put screenshots but i'm sorry i
0:10:38didn't have screen shots
0:10:40it's quite an acid trip because you have this like
0:10:44list of events that an object can generate like two signals and you have
0:10:51that's like in your plate right and then you have your source code editor which
0:10:55is that code which is kind of like sensitive drop target right and you grab
0:11:00your
0:11:01grab your signal and it's in another window
0:11:05and you drag it to the method and then that means that method is going
0:11:10to rip sponsor that signal on that object which is component child if you're right
0:11:16that's a big blue line just strands across the screen
0:11:20anyway
0:11:22it's but it's really practical i mean it looks really strange but it's really practical
0:11:31there is actually so many things that we need to do in late to support
0:11:36this properly
0:11:38"'cause" right now we only support just creating a
0:11:42object class right which is komplet defining one composite object class but
0:11:49another example of a cool feature to do is in adobe flash create or you
0:11:56can take
0:11:57you can just go ahead in your work flow will be i'm gonna design interface
0:12:02and there
0:12:05i mean it design interface
0:12:08right
0:12:09and
0:12:11i have my i don't know my album jacket you know and
0:12:15my song titles and you know my
0:12:19more but
0:12:21i don't know okay
0:12:23in search
0:12:25money no
0:12:27whatever's going on there
0:12:30and so i have a mock up and then i can just like take this
0:12:33box
0:12:35alright and i can right click on it
0:12:39and say export that as a class
0:12:42no just give me give me a list browser because i'm gonna use that in
0:12:46like three or four more of my interfaces
0:12:50so this one is like maybe a
0:12:53i don't know song browser screen you know and
0:12:57this one becomes a class called soundless
0:13:01you know
0:13:05that's from a i don't know but catalyst i use that with action script three
0:13:15there's air there's the
0:13:18but it's a i think that paradigm is going to work just as well as
0:13:25on air as on your streaming swr
0:13:30but it's really practical because then you have this new objects and you can either
0:13:34export it as a class which means that you're going to implement it
0:13:39or you can just since it's flash right you have these compose it thing is
0:13:43and they're just drawings and pictorial object right so you don't really need to have
0:13:48cool
0:13:49we can just use them and paste them
0:13:53and what's really interesting is that you have a project that's composed of like maybe
0:13:58ten classes
0:14:00and when you modify one then you see the change in the other and everything
0:14:05is reactive
0:14:08this is where i want to go with collate
0:14:13so how far did i go
0:14:16yes
0:14:19before we continue
0:14:24i did pull this out
0:14:25this is how it's done
0:14:28this is how it's done in
0:14:31coke or and the next step in interface builder
0:14:36basically
0:14:39you have this guy right i be outlets is a syntactic sugar that's custom for
0:14:45the next that objective C implementation
0:14:49and declaring your you while able as an I B outlet means that my text
0:14:55is associated with an object that's in the next that interface builder file so
0:15:00syntactic sugar that basically means that label is part of might need file
0:15:06and that same thing goes for
0:15:10i be action
0:15:11button pressed
0:15:13right
0:15:15so
0:15:17as you can imagine you only get to see that ellison teacher blue line across
0:15:23the screen if you have an I B action on that method that can handle
0:15:26that signal
0:15:28right
0:15:32right so that's i don't have flash script i wanted to have action script because
0:15:37it's more cute then we then the objective C but
0:15:44i couldn't put it together so
0:15:48and that's all because you guys started one day early
0:15:56alright
0:15:58this is this is what was on the internet on my blog site
0:16:03when we got it when we for men got it working with dollar
0:16:10his name is luke a
0:16:13that's right
0:16:16so here you can see the same pattern is repeated
0:16:20except we have this extra syntactic sugar which means you're probably class is going to
0:16:25be a template
0:16:27i'd this isn't exactly a tutorial about how to use power actually
0:16:31i am a big advocate of all the but i've never used it myself which
0:16:35is a bit strange but
0:16:40maybe i was told that means i'm a true believer
0:16:46huh i
0:16:47right so
0:16:49well the distinction is in objective C you have to use this controller object class
0:16:55which i thought was kind of silly and i didn't what i did not want
0:16:58to repeat that in G T K but they have this object can just you
0:17:02why view controller object which is
0:17:06it's a kind of metal objects around your screen
0:17:09and
0:17:10only using that object can you create compensate the interfaces
0:17:16so here we have the equivalent you have dedicate templates do you take a child
0:17:21is pretty much synonymous with the I B outlet
0:17:26to let you to
0:17:29course in C code this is a little bit more verbose but
0:17:33but i think that we've got something really much nicer much more bleeding edge cutting
0:17:39edge and i wish that i had the
0:17:43screenshots to show it off better
0:17:45to make us a little bit more ashamed about how behind we are
0:17:49right
0:17:52and so do you take a child and you take a callback right
0:17:56now this is pretty simple you can create a class
0:18:00create a you wife i'll put it all together this is just going to work
0:18:05in this demo you have an entry
0:18:08and you have of virtual text property
0:18:12actually yes its kind of virtual because there's no storage you'd only sets the text
0:18:17on its delegate entry object
0:18:20and then when the entry changes
0:18:24he notifies that virtual property has changed and that's a callback which is of course
0:18:30connected to the entry inside the late file
0:18:35in response to it's changed signal
0:18:44who
0:18:51it's
0:18:52what is it needed for
0:18:55it is
0:18:57it declares your method or your function as a an endpoint for a signal that
0:19:04can it
0:19:05it becomes accessible to the name space that glade refers to for signals because we
0:19:11couldn't really except D L open G L send
0:19:15you know
0:19:16so you know this kind of nice or you know like so the class itself
0:19:22create a dictionary of
0:19:25functions which can be called and the
0:19:29the interface file the interface description only has access to those symbols
0:19:36judy cable there will fall back to D else in but you don't have to
0:19:39remember that
0:19:46okay
0:19:49i'm sure more parenthesis
0:19:57right so we went over this in the beginning basically
0:20:02adding this doesn't make anything new possible i've seen this
0:20:06approach
0:20:08there was a there was a python library are a something i remember but the
0:20:15they had their own
0:20:17kind of implementation of this but it was like a base class how to teach
0:20:21a builder instance
0:20:23who would you know like they it would respond to calls of like get this
0:20:29or get that by looking at its own builder file then
0:20:34but you know people have been doing similar things but
0:20:38having an infrastructure for actually doing it
0:20:42makes it so that people actually do it and that it's easy for them
0:20:46that makes all the difference
0:20:50right and we don't find these situations where
0:20:54some code is reacting to you know like
0:20:58you press the button
0:21:00in your callback that change the entry and the other guys
0:21:05hearing the entry changing he's setting the end of the scroll bar to be not
0:21:09sensitive and
0:21:11and it can go in every which direction but
0:21:14since you have that built into a late file built into an object class then
0:21:19there is no room for
0:21:22unexpected instances of it
0:21:25implicit invocation
0:21:27so
0:21:29i kind of think it's a good idea to move towards explicit invocation everywhere you
0:21:35can "'cause" you just can't really define how program runs if you're relying solely on
0:21:42a reactive system
0:21:44everything is just reactive to each other
0:21:51and reducing steps right so this is this is where we want to go with
0:21:56played we need to redo steps
0:21:59and by doing that's well i it implies that somebody here is gotta give us
0:22:05a few hundred thousand dollars to invest in making late but
0:22:10if we do it
0:22:13right it implies a lot of work you know because as soon as we start
0:22:17looking at these kind of features that they're doing in adobe flash or in
0:22:23in interface builder
0:22:26we're looking at us
0:22:28making a single project full of a lot of different late files
0:22:33all these play files a part of the same project now and one thing changes
0:22:37so you have you have to unify the undo redo stack you have to do
0:22:41all kinds of
0:22:44all kinds of facts lips tricky stuff
0:22:48has to be done especially if you want to get that feature which i want
0:22:52you know
0:22:53the experience of just throw up a markup and then break it up and create
0:22:59an implementation from that markup
0:23:02which is great well you need a lot of work to get that done
0:23:07and
0:23:08basically that's what we're looking for good ideas to reduce the steps
0:23:14reduce this that's in the process of creating a good user interface without
0:23:20you know without making it right
0:23:23while keeping it
0:23:24keeping it great keeping it clean
0:23:28and making it easy
0:23:30that's what we want to do so any suggestions
0:23:36yes that's true
0:23:42so something that approach on we can talk about right now is help you read
0:23:46well not to sit don't three take it recommends like using specific spacing specific padding
0:23:53and all that sort of stuff and right now i'm about simply when you insert
0:23:57a child widget it's like it's all went up the next to each other of
0:24:02a quick thing or so easy thing that i would say but i don't know
0:24:05the plate will base is recommending a good set of default so you get a
0:24:08good home three compliant apple right out of the right of the box
0:24:13so i mean it sort of our cargo but i think that we need to
0:24:17think about how we wanna strictly interpret making no maps going for
0:24:22and i know what a problems and everything magical you don't space back how you
0:24:32it's from the window we are do you
0:24:37we've
0:24:40we circled around that for a while we have this
0:24:44custom code forty to get dialogue and there's a kind of trick like there's a
0:24:48one little nasty trick about indicate dialogue is that the child of the content area
0:24:55must have five pixels border
0:24:58but not the content area itself because that would cause the action area to also
0:25:04gained a border
0:25:05so it's kind of really young you know and some of those some of the
0:25:11things that G T K's doing with padding
0:25:15which is sensible is
0:25:18assigning it from star properties
0:25:20like a few of the G T K dialogue good space things and patterns are
0:25:26like you can set them but it means nothing it will it will be overwritten
0:25:30by style thing settings when adjudicate dialogue initialises
0:25:37a big question we have to ask ourselves about that is do we want to
0:25:41relinquish all of that for C S
0:25:43control it
0:25:45but it's definitely something to look at
0:25:49i also one more question what well i actually just be able to fly widgets
0:25:53around to reorder problem and
0:25:59hypothetically right now no
0:26:03boy
0:26:05it's not working
0:26:08it somewhere
0:26:10well actually thank you so much that's i
0:26:19what about putting for non widgets what about with what's for non widgets
0:26:24for non widgets like your application
0:26:32and we move be there to do you
0:26:46right you says also is the main thing to do you live
0:26:53now we it's i guess it's true we cannot really you know expand let's go
0:26:57until we bring it lower but i understand that you take a builder might not
0:27:03be the thing
0:27:05it might not be the implementation it might be
0:27:09might be something barry and based or i don't know what i don't know i
0:27:14don't know
0:27:16and we probably need we need serialisation as well is D C realizations right if
0:27:21we're gonna move something like that instance you bright no i'm not talking about you
0:27:25need to do that but i mean it's fine if it's okay but if the
0:27:28and i can also use it to construct things that are not which it's like
0:27:31say for example there's this semi common paradigm where you have mostly static menu structure
0:27:38but then you have like you know one menu that you wanna be dynamic or
0:27:41one section so you have some menu layout and then you have a and i
0:27:45on one subsection that's like recent talk
0:27:49something like that or your bookmarks
0:27:50and then you would want that become an instance variable in your application so that
0:27:54it's easy to access
0:27:56so it is it's really liked the same internal try but it's not being done
0:28:00with widgets
0:28:02well okay of course you have that at G T K application we know little
0:28:06but to take application
0:28:09it would have to be a rewrite i mean it would have to be a
0:28:11ports because we have this abstract class it does a lot of stuff
0:28:15right
0:28:18maybe we can do it with those like default implementations of interfaces
0:28:25but even then i think it would be a big can of worms
0:28:31i exactly yes
0:28:54no
0:28:56no that's no well it's
0:28:58no it can but there is a few quirks i mean do you take a
0:29:03widget as the destroy signal and we use that to memorandum memory manage those instance
0:29:09variables right
0:29:11probably
0:29:13it's probably you
0:29:27it well it could be documented that the instance variables
0:29:31exist until the first dispose cycle
0:29:35it might not be so find in practice
0:29:39but
0:29:57i don't know it technically the technically the implementation should work fine with objects
0:30:03it really should there's nothing really widget specific except that you know we have to
0:30:09take a container
0:30:12it helps you know
0:30:14but it does it you know like i mean actions go in action groups in
0:30:18you know text tags go and text tag tables and
0:30:35okay was it was it not long enough do you need me to make a
0:30:38performance
0:30:47that's twelve and that makes forty minutes or some
0:30:56that's
0:31:00they
0:31:02it's it has to do with your arriving early it was a preemptive attack must've
0:31:07been coordinated yes
0:31:14i think i read recently that a lot of the you wanting ladies
0:31:18generated essentially
0:31:20is to generated
0:31:23yes we well generated it's with templates
0:31:29right
0:31:30i mean wanting out become quite interested in doing is
0:31:34like designing it yes definitely and the summary things that are in the you want
0:31:42don't need to be
0:31:44i i've been i've been starting to prefer those like
0:31:48that symbolic icons
0:31:50we can also much no
0:31:54that's little
0:31:55plus and a minus it's very personal thing fruit
0:31:59and basically they we have like thirty you why files
0:32:05in the plug ins directory that like you can load and
0:32:10it doesn't look exactly the same as in the end result but that's you know
0:32:14you can edit those editors in played and i did it very fast
0:32:21and knowing that you can change
0:32:25right
0:32:39okay well we do generate the property editors based on what is in the widget
0:32:44class
0:32:54well someone
0:32:55some of the interesting things are like stuff that i
0:33:00stuff they can be hidden
0:33:02you know that it's not really useful as a property in your face but like
0:33:09but a different way to set it you know like right now i have in
0:33:13the common tab i have a tool tip property
0:33:16and i have a check mark whether it's whether it's with markup
0:33:21the way i don't have like a tool tip property and it like a tool
0:33:25tip text property and a tool tip markup property you know like
0:33:39well how long ago did you see the editors
0:33:43less than a month
0:33:46more than a month
0:33:51let's see what it
0:33:56little at least
0:34:11let's see what i got here let's hope it doesn't crash right startup but
0:34:17okay so what do we got
0:34:20it's this is very small screen it's pretty bigger
0:34:27right so
0:34:36i
0:34:37this is what this is
0:34:41i
0:34:43i have some like this is that application chooser dialogue and then isn't there
0:34:53there is the where is it
0:35:04and this is an application chooser widget
0:35:17that's not a good example
0:35:19let me just find one that's the is
0:35:24the font but don't know where is that
0:35:32in the middle
0:35:34okay
0:35:49i of course
0:35:58right so up here we have point user attributes
0:36:02and
0:36:07and the where is the one chooser widget again
0:36:10it's just the
0:36:14that's the combo box accent font button there
0:36:18and then this one so i have this box here font button attributes
0:36:24and so like i have this one and everything that's a fonts
0:36:28you know one selector
0:36:30i just use that again
0:36:33and i repeat it
0:36:35and that that's works for like that choose are the recent choose are the there
0:36:39all shared components of components
0:36:48no actually right now after doing all that i did not remove anything everything is
0:36:53still there
0:36:57no i would not be opposed to that at all like we had that conversation
0:37:02before like maybe there's an advanced mode
0:37:05maybe there's a different view or something more
0:37:10you know like i've been resisting the tree view idea for properties because i wanted
0:37:16to get there
0:37:17for so long but now that i'm there wouldn't be a bad thing to have
0:37:22that review it as well because
0:37:27search for properties yes
0:37:36i
0:37:39this isn't this is the widget editor know in the comments that
0:37:45yep your visible
0:37:48flags and
0:37:50this is the tool tip it has a custom button that means that you know
0:37:54you're going to it's gonna has tool tip true
0:37:59so then you get the query tool tip signal right
0:38:05yes it can be empty like
0:38:18and it's gonna be you know it's a it's gonna be even better when alan
0:38:23runs his fingers through the grooves between the widgets and adjust the spaces
0:38:32i hope that
0:38:43a accelerators
0:38:45yes it is
0:38:47it is
0:38:53it's possible maybe
0:38:57actually those are the actual property others which are mostly custom widgets
0:39:02and it's possible that it's like
0:39:05in the U I description but it's possible that it's in that custom widget
0:39:10which is faulty not expand
0:39:14alright
0:39:18so does that do it anybody want to come do would dance
0:39:24okay
0:39:45okay we have things to discuss
0:39:56we can we can have a mud wrestling competition and you know like we can
0:40:01do get out and
0:40:03maybe will like for G action to be you know G T K action because
0:40:08it's like all of the same features only we don't change the A P I
0:40:17we
0:40:19right that called
0:40:21well
0:40:24once okay
0:40:26it was a right