GUI: Under the Hood - Computerphile

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024

Комментарии • 268

  • @sortsvane
    @sortsvane 5 лет назад +670

    More under the hood videos please. In modern times we have got so much abstraction going on most of don't know how things work at their core. Would love this series.

    • @LiamMayfair
      @LiamMayfair 5 лет назад +31

      I would honestly watch an entire online course on how GUI programs work under the hood. There's tons of information on the internet on how to write GUI applications with popular toolkits and frameworks, but none that explain how the operating system actually deals with all that stuff.

    • @TheAdriyaman
      @TheAdriyaman 5 лет назад +10

      "In modern times we have got so much abstraction going on most of don't know how things work at their core" -> Not necessarily a bad thing

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 лет назад +3

      @@LiamMayfair Modern operating systems don’t tie themselves to a particular GUI layer. Microsoft and Apple do, but Linux doesn’t.

    • @Casowsky
      @Casowsky 5 лет назад +12

      @@TheAdriyaman You're not incorrect, but for many people it really helps connect the understanding of these high level frameworks when you can learn exactly how all the low level operations work.

    • @KrushKingdom
      @KrushKingdom 5 лет назад +17

      I agree. I feel like with a lot of abstracted concepts, you'll just get told to use a framework. But that doesn't tell me how things _really_ work. My question is, how did they know _how_ to implement these things in the first place (when there was no framework)?

  • @SimGunther
    @SimGunther 5 лет назад +274

    Would love an under the hood video on the gcc compiler :/

    • @peppybocan
      @peppybocan 5 лет назад +47

      that would be a long and painful road :D JRR Tolkien would look like a total noob compared to GCC pipeline :D

    • @shukterhousejive
      @shukterhousejive 5 лет назад +47

      10 minute loop of a man screaming

    • @Wyvernnnn
      @Wyvernnnn 5 лет назад +1

      Llvm is more sane

    • @perkele1989
      @perkele1989 5 лет назад +9

      No, you really dont.

    • @totlyepic
      @totlyepic 5 лет назад +8

      Having any meaningful understanding of a compiler pipeline is going to require more time than Computerphile videos run. Maybe they could do a multi-parter as a high-level intro to the topic, but it really isn't a small topic.

  • @TheSquarecow
    @TheSquarecow 5 лет назад +43

    It's super charming that someone in the Year 2019 says something like "whether you are programming for RiscOS, Atari or Amiga..." :D yup, these are still the relevant platforms. At least in my mind.

  • @erikalm6221
    @erikalm6221 5 лет назад +124

    This is a humble request for a video about open source hardware like RISC-V

    • @arw000
      @arw000 5 лет назад

      THIS PLEASE!

    • @Studio-df7ge
      @Studio-df7ge 4 года назад +2

      Its not hardware... Its basically a protocol on how cpu recieves and executes commands. Only instruction set is open source, and the actual hardware to use RISC-V is a trade secret

    • @erikalm6221
      @erikalm6221 4 года назад

      @@Studio-df7ge My understanding is that the ISA is open source and how you construct your CPU to use it is up to the producer to share or not. So in a broad term, open source "hardware".

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 5 лет назад +28

    6:10 A common use for mouse-moved events is changing the mouse pointer, e.g. making it an I-beam pointer when the user moves into a text field, to indicate that they can type there.

    • @Validole
      @Validole 4 года назад +5

      That's a mouseover event, not a mouse-move event: you want the OS to do the neccessary work to determine whether it's over a relevant part of your window: working it out yourself is error-prone if you have scaling, font rendering etc to consider. An example of where mouse-move is relevant is looking around in a 3D environment or panning the screen via dragging (although that could be a separate drag event?)

    • @mlfconv
      @mlfconv 4 года назад

      comes from apple camp

  • @notsobob
    @notsobob 3 года назад +8

    I love Dr Steve Bagley; even though most of the time the very last sentence/utterance of his current train of thought makes little sense, he is exceptionally erudite for someone who is seemingly just speaking from the top of his head! Editing probably helps a tiny bit, but I love the speed and eloquence with which he can disect such a complex topic as how to code a gui OS!

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 5 лет назад +10

    2:57 One subtle point worth noting is that the GUI framework usually handles keyboard autorepeat. That is, when you ask for another event, no “real’ event is pending, and a key is still down from the previous one, and the autorepeat interval has elapsed, then the framework will generate an autorepeat key-down event for you.
    Note that these autorepeat events are not buffered, so they are only generated as quickly as your code can handle them. Thus, autorepeat can never run away from your program’s ability to respond!

    • @PaulaJBean
      @PaulaJBean 5 лет назад

      Also, programs usually don't handle WM_KEYDOWN and WM_KEYUP, but they _do_ handle the WM_KEYPRESS which is synthesized by Windows.

  • @martixy2
    @martixy2 5 лет назад +16

    Yea... modern browser rendering engines are crazy complicated. You go through 4 separate steps - compute>layout>paint>composite. Some of these happen on the CPU, some on the GPU. When playing around with complex CSS/JS, some changes trigger all 4 steps, some trigger less and a web developer needs to be mindful of all these.

  • @alfawavesgrowth
    @alfawavesgrowth 5 лет назад +53

    Would love a bigger dive how the OS handles the message loop. How one could implement such GUI without an operating system like, for example when using a custom SoC or microcontroller.
    Love all your work and the way the speakers present the info. Keep up

    • @mrrdelorenzi8478
      @mrrdelorenzi8478 5 лет назад +11

      Truth is, it is not a loop: At the top of the loop is an instruction to wait for an event. Therefore a better way to see it, is a routine that runs to completion, every time an event comes in. And all events are eventually (as you trace them back) interrupts.

    • @abbasramish5803
      @abbasramish5803 4 года назад +1

      Have you got anything more related to this ? I have bern searching for articles, Videos. Could not find out

    • @yash1152
      @yash1152 2 года назад

      @@mrrdelorenzi8478 i think this above comment by Abbas Ramish was asking you, so, have you got any resource related to this?

  • @GeorgeNoYoutube
    @GeorgeNoYoutube 5 лет назад +87

    I personally prefer a crispy program to a gooey one

  • @9arm.
    @9arm. 5 лет назад +4

    I cannot not focus on his shirt pattern that is blurred and turned sharp again over and over. Now apply knowledge from picture compression video.

    • @Computerphile
      @Computerphile  5 лет назад +2

      Yes I had a bit of a shocker with focus on this video! >Sean

  • @YourMom-rg5jk
    @YourMom-rg5jk Год назад

    I always get recommended something by computerphile I didn't even know I wanted to learn about but I love it every time.

  • @KanalMcLP
    @KanalMcLP 5 лет назад +19

    Now I understand where this Windows XP Not Responding Art comes from :D

    • @TheMixedupstuff
      @TheMixedupstuff 5 лет назад +6

      Exactly the reason. Also when the Windows detects a program has not processed any events for a while, it does the "not responding" message.

    • @PaulaJBean
      @PaulaJBean 5 лет назад +1

      Indeed, that's when the underlying window doesn't process it's WM_PAINT messages properly.

    • @ataksnajpera
      @ataksnajpera 5 лет назад +3

      I think that default timeout is 5 seconds. If program does not process any messages then you get that "not responding" message.

    • @BrandonBeanland
      @BrandonBeanland 5 лет назад

      @@ataksnajpera yeah. Especially for programs that process data in long chunks without sending messages saying that it's still working.

    • @MladenMijatov
      @MladenMijatov 5 лет назад +1

      It comes from a poorly designed window manager that Windows has. The whole processing messages thing is a nightmare to handle. No other operating system has this issue because window manager is the one handling painting of buffers not the application itself.

  • @mrexodia
    @mrexodia 5 лет назад +3

    Very nice video! Perhaps it could be interesting to discuss the contrast with intermediate mode GUIs as well...

  • @GammaFn.
    @GammaFn. 5 лет назад +5

    4:05 In fact, in windows under Wayland compositors don't get any information on their locations or z-order relative to other windows.
    14:10 Wayland compositors can implement transparency should they choose to. Due to the design decision of windows not knowing their z-order, all it comes down to is asking the windows underneath to redraw their surfaces.

    • @Wyvernnnn
      @Wyvernnnn 5 лет назад

      Wayland breaks everything part MCXVII

    • @GammaFn.
      @GammaFn. 5 лет назад +1

      I mean, when you're replacing Xorg wholesale with a completely new design, everything is inevitably going to break. No need to worry, all the toolkits have been ported to wayland, so as long as you're using GTK+ or Qt or SDL or EFL, you won't notice a thing.
      (This comment was sent from my Wayland session.)

    • @Wyvernnnn
      @Wyvernnnn 5 лет назад

      @@GammaFn. You can't really fix some design choices; like not being able to see another software's viewport. It broke ShareX for instance.

    • @GammaFn.
      @GammaFn. 5 лет назад +1

      There are now widely adopted protocols for screenshotting and screen recording, and if there is a large enough need for capturing footage from a wayland surface, someone will likely design a protocol to allow that.
      So yes, you can fix those design choices. It was just a design choice to not make those protocols part of the core spec.
      EDIT: actually, the core protocols don't even specify how to display a window... Even xdg-shell is an extension

    • @Wyvernnnn
      @Wyvernnnn 5 лет назад

      ​@@GammaFn. Oh cool, I didn't know.

  • @system.out.printlnsmartert5781

    I never thought I'd be learning about this stuff in such depth. I love computer science.

  • @zachlorge7043
    @zachlorge7043 5 лет назад +18

    “Object oriented frameworks” O.O.F.

  • @user-yr1uq1qe6y
    @user-yr1uq1qe6y 5 лет назад +4

    Great detail! Video games were the original GUIs :)

  • @fllthdcrb
    @fllthdcrb 5 лет назад +24

    4:03 Actually, Emacs calls them "frames", and reserves "windows" to refer to divisions within frames. Like, if you type C-x 2, the current window gets split into two. Yeah, it's non-standard terminology.

    • @danielsharp2402
      @danielsharp2402 5 лет назад +3

      Also JFrame in java.

    • @AnastasisGrammenos
      @AnastasisGrammenos 5 лет назад +1

      I think what you call "windows" are actually the buffers. You can have many frames (e.g. UI Windows) of emacs and each frame has it's buffers (either one, or split in any way)

    • @fllthdcrb
      @fllthdcrb 5 лет назад +2

      @@AnastasisGrammenos Nope. Buffers are the things that hold the contents of files (and other things). A window can be viewing any buffer at a given moment. You can even have multiple windows viewing the same buffer, possibly at different places. The C-x 2 I cited activates the command "split-window-below", with this description: "Split the selected window into two windows, one above the other. The selected window is above. The newly split-off window is below and displays the same buffer."
      Like I said, non-standard terminology. Might be because Emacs originates from before window systems (1976, specifically). ...Man, that's almost half a century ago!

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 лет назад +2

      The reason for that should be obvious: it’s because Emacs was originally doing “windowing” on text terminals, before GUIs became commonplace. Rather than change their terminology, they simply added another nonstandard term, “frames”.

    • @johnvonhorn2942
      @johnvonhorn2942 5 лет назад +1

      Harry Hill refers to them as frames as well and when you select one the operating system sends a message saying, "You've been framed"

  • @mattt2684
    @mattt2684 5 лет назад +8

    The event polling is similar to SDL

  • @trly429
    @trly429 4 года назад +1

    They are just one, big, while true loop.

  • @harleyspeedthrust4013
    @harleyspeedthrust4013 4 года назад +1

    Lol that windows message handling stuff reminded me of win32 programming in C. Those were fun times haha

  • @YaroKasear
    @YaroKasear 5 лет назад +2

    Yeah, Wayland does that, Wayland's entire thing is composting just like Aero and whatever the heck Apple calls their window manager these days. There's plenty of window managers for Xorg that do it too now. Most likely if you're using a full desktop environment, it's not using a traditional stacking window manager anymore.
    Also, it's been a while since I've done Windows GUI stuff, I know on Qt 4 (Not sure about 5.) you DO have MouseMove events, or can. The way the MOC on Qt works is simply not to include any handler for events that aren't there at all.
    I personally don't understand why more toolkits don't use callbacks instead of forcing the use of enormous switch structures, though, sort of akin to what was described in Windows. Rather than do a bit switch and an inefficient loop, just simply have the OS call a function within a program registered to the event instead.

  • @ozwomp
    @ozwomp 5 лет назад +3

    The more I think about it, the more in awe of that shirt I am.

    • @nosuchthing8
      @nosuchthing8 5 лет назад +1

      I want that shirt

    • @PaulaJBean
      @PaulaJBean 5 лет назад +1

      I tried to see constellations, but I failed.

    • @ronnetgrazer362
      @ronnetgrazer362 5 лет назад

      His shirt may be blue, but the noise on it isn't.

  • @TNTsundar
    @TNTsundar 5 лет назад +18

    I want a video on how multiple objects (Windows/widgets) are composited on the framebuffer. I am working on a graphics library in C for fun. Basically it can draw lines, boxes, etc as of now.
    I have to draw multiple such objects onto the screen and they might move based on user’s inputs. I’m thinking to have virtual framebuffer with functions that draw the respective objects from back to front so that the objects in front masks out the window in the back.
    A video on that would be nice.

    • @davidmcgill1000
      @davidmcgill1000 5 лет назад +1

      Might be interested in looking up blitters.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 лет назад +1

      Non-rectangular clipping regions are your friend.

    • @TNTsundar
      @TNTsundar 5 лет назад

      David McGill Thanks! Will do!

    • @electron8262
      @electron8262 5 лет назад

      Sounds cool! What's your library called?

    • @TNTsundar
      @TNTsundar 5 лет назад

      Albert Tománek I haven’t got a name for it. It’s still work in progress. Interested to collaborate?

  • @rafagd
    @rafagd 5 лет назад +7

    You do get loads of mouse move events in most gui frameworks.

  • @orlovsskibet
    @orlovsskibet 5 лет назад +1

    I love these videos!
    This was a nice trip down memory lane, to back in the days when we acutally interacted with message queues when writing applications. 😊

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 лет назад

      What’s the alternative? You’re not suggesting multithreading the GUI, are you?

    • @orlovsskibet
      @orlovsskibet 5 лет назад

      @@lawrencedoliveiro9104 🙄👀

    • @PaulaJBean
      @PaulaJBean 5 лет назад

      @@lawrencedoliveiro9104 Modern frameworks isolate the developer from the low-level message stuff.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 лет назад

      @@PaulaJBean You’re not suggesting we use callbacks instead?

    • @PaulaJBean
      @PaulaJBean 5 лет назад

      @@lawrencedoliveiro9104 Indeed I am. Modern GUI apps work like event-driven, like in Hollywood: "We'll call you if needed, don't call us." There is no need to write messageloops anymore.

  • @JivanPal
    @JivanPal 5 лет назад +1

    Sometimes to prevent ambiguity, people refer to windows as "frames", though this usually refers to a specific "sub-window" within a top-level window.

  • @konstantinrebrov675
    @konstantinrebrov675 4 года назад +1

    Could Dr Steve Bagley also create a video about how file formats work under the hood? How are they laid out in memory and read by the program? For example, how are pdf, word documents, video, and audio files stored in the memory and how can we write a simple C program to parse this information and do something useful with it?

  • @Pinefenario
    @Pinefenario 2 года назад +1

    Ah that’s why the xcode / Android Studio / Flutter programs are so big and have so many files. When I as hobby programmer create an ‘Hello world’ app for my iPhone most of the work is already done. Nice explanation by the way!

  • @HebaruSan
    @HebaruSan 5 лет назад +6

    MouseMove events are very common and used to implement things like hover effects

    • @synchronos1
      @synchronos1 5 лет назад +5

      I'd say that it's more common that they're implemented using MouseEnter, MouseLeave or Mouse[H]Over events provided by the OS than interpreting raw MouseMove events to determine those by yourself.

    • @LudwigvanBeethoven2
      @LudwigvanBeethoven2 5 лет назад

      MouseMove is bad, MouseEnter/Leave is much better, only two events required

    • @louiscloete3307
      @louiscloete3307 5 лет назад

      @@LudwigvanBeethoven2 but then you can't drag and drop without another extra command.

    • @MyFilippo94
      @MyFilippo94 5 лет назад +1

      Isn't in most cases the mouse position accessible as a 2D vector variable?
      Using some pseudocode here, you can activate drag on Mouse.LeftButtonDown(), use the vector to handle the drag, and end the drag on Mouse.LeftButtonUp().

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 лет назад

      @@LudwigvanBeethoven2 MouseMove needs to be carefully controlled. For example, the WaitNextEvent() call he describes takes a mouse-region argument, and a mouse-move event is only generated when the mouse leaves this region.

  • @ParadigmSh1ft_
    @ParadigmSh1ft_ 5 лет назад +1

    I'm surprised they didn't touch on the move to embedded browsers to create GUI's using web technologies to save money. A given it is still the same underlying principals with an abstraction layer.

  • @heidirichter
    @heidirichter 5 лет назад

    Oh wow, this really underscores to me just how advanced the Amiga windowing environment was in comparison to other systems. But I guess it had to be, given such a polling loop would have been a very bad idea in a multitasking system running on a 7MHz 68000 CPU.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 лет назад

      The Amiga could never handle non-rectangular windows, though. The Mac could.

  • @richfi9576
    @richfi9576 5 лет назад

    is this brand new Computerphile spatial technology at 4:07? Mind blown...

  • @Henrix1998
    @Henrix1998 5 лет назад +8

    Tl;Dr: it's a huge mess eventhough it feels simple at first

    • @PaulaJBean
      @PaulaJBean 5 лет назад

      It's meant to make it easier for the user, not easier for the developer. If you want something that makes you happy as a developer, try Python or Ruby.

    • @MladenMijatov
      @MladenMijatov 5 лет назад

      It's not as huge of a mess as it is poorly explained.

  • @satyris410
    @satyris410 5 лет назад

    In human-computer interaction, WIMP stands for "windows, icons, menus, pointer",[1][2][3]denoting a style of interaction using these elements of the user interface. It was coined by Merzouga Wilberts in 1980.[4]

    • @Wyvernnnn
      @Wyvernnnn 5 лет назад

      We stopped using that purposefully

  • @thogameskanaal
    @thogameskanaal 2 года назад

    Does the operating system also handle debouncing of button inputs?

  • @eddnufc93
    @eddnufc93 5 лет назад +2

    Gets confusing when talking about windows... by windows, do you mean windows or windows.

    • @LittleRainGames
      @LittleRainGames 5 лет назад +2

      windows

    • @louiscloete3307
      @louiscloete3307 5 лет назад +1

      windows or Windows would be less confusing in the written form...

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 лет назад

      I like to use the term “Dimdows” for the Microsoft product. Everybody knows what I mean. ;)

    • @klaxoncow
      @klaxoncow 5 лет назад

      Yeah, this works far better in written form, as you can tell the difference between the common noun "windows" and the proper noun "Windows" by the capital letter.
      Ah, but this is Microsoft through-and-through, happily trying to take monopolistic control over the English language itself:
      "Windows™", "Word™", "Excel™", "Access™", "Paint™", etc. - all of which are just singular plain English words - and then they just slap a trademark symbol on it.
      And they really did try to sue "Lindows" over its portmanteau of "windows" and "Linux" - but, thankfully, this failed in the court because "windows", without the capital letter as a common noun, is a standard English word and also the generic term for a screen portal, so their arrogance backfired on them there, as it was deemed that "Linux + windows" are two things that have nothing to do with Microsoft (and the capital "L" in the portmanteau comes from "Linux", which is a proper noun and NOT a common English word). So the court ruled "mind your own business and go away" on that one.

  • @fghdfghdfghdfg
    @fghdfghdfghdfg 5 лет назад +1

    Suggest looking at Dear ImGUI, it's a great example of immediate GUI's.

    • @yash1152
      @yash1152 2 года назад

      what's "immediate GUI" ??

  • @dealloc
    @dealloc 5 лет назад +1

    I wonder what the latest WIndows 10's Reveal Highlight feature works under the hood, where interactive controls are highlighted near where the cursor is positioned.

    • @SimonBuchanNz
      @SimonBuchanNz 5 лет назад +2

      Use mouse move messages to know when you need to draw, draw brightness per pixel depending on the part of the control and distance to the mouse. It's surprisingly easy!

  • @recklessroges
    @recklessroges 5 лет назад +4

    Tkinter master race.

  • @chuang6248
    @chuang6248 2 года назад

    When the mouse xy position send to system how system find click window or button from many windows? By a loop determine window border insider(If stacked)?

  • @RagHelen
    @RagHelen 5 лет назад

    Great short!

  • @89Sawik
    @89Sawik 5 лет назад +1

    Regarding naming windows "windows". In framework called wxWidgets the "windows" are called "Frames" and basically "Widgets" (buttons etc.) are called... "Windows". Just a little curiosity.

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 5 лет назад

    1:54 One problem with the Windows approach was that every GUI element (every button, menu, possibly even every menu item) was a “window” as far as the OS was concerned. And storage for every “window” was allocated from an area known as the “system resource heap”, which only had a small, finite size. So your machine could have lots of RAM, but if the GUI was too complex (or you had too many of them running at once), you could still run out of system resources!

    • @PaulaJBean
      @PaulaJBean 5 лет назад

      Windows is windows turtles all the way down.

    • @yash1152
      @yash1152 2 года назад

      umh, "one prob with Win OS was" --> was, or still is??
      if was, then how was it mitigated??

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 2 года назад

      As I understand it, this is still a problem.

    • @afar5y
      @afar5y 11 месяцев назад

      many programs these days I believe use their own custom rendering engines, so that shouldn't be a problem these days

  • @sovietslav7082
    @sovietslav7082 5 лет назад +2

    Great job as usual, keep it up!

  • @NethTech
    @NethTech 5 лет назад

    As for another name for "window", on Windows they are commonly called forms at least in the development scene

  • @mybigbeak
    @mybigbeak 5 лет назад

    I've ju;t got my head around this stuff recently, if I'd only had this video sooner.

  •  5 лет назад +5

    And now you know why the background window goes dormant/unresponsive when a GUI dialog pops up :-)

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 лет назад

      It doesn’t for me. What OS are you using?

    •  5 лет назад

      @@lawrencedoliveiro9104 it doesn't happen always, the dialog must be synchronous. Then the event loop for the window will "pause" and switch to the dialog - this allows you to simply write
      response = openDialog()
      in your code and block the program on that line until that dialog closes. If you want both the back window and the dialog to be responsive, the dialog has to be asynchronous.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 лет назад

      @ Look at GIMP, for example, for which GTK was originally developed; in filter settings dialogs, there is usually a “preview” button, which lets me see the effect of the settings on the image in the main window. I can move the dialog around, scroll around the image etc and have it update in real time until I do “OK” to confirm the filter application or “Cancel” to restore the previous state of the image.

    •  5 лет назад

      @@lawrencedoliveiro9104 yes, as I said, it depends on the dialog/window that the programmer chooses. If you choose a synchronous dialog/window (usually used for simple yes/no prompts or alerts), the window in the background cannot update, otherwise it couldn't be synchronous in the code. Of course this does not make sense for a preview dialog and therefore the dialog that you describe is asynchronous, which makes it a bit harder to handle in code.
      You can see examples of synchronous dialogs in web browsers - a simple prompt/alert is synchronous and therefore you cannot use the tab in the background while it's active (although this is not a typical example as I suspect it's simulated in the browser, because for example video playback continues during an alert). Error alerts and prompts in Windows apps typically used to be synchronous.

  • @selbstwaerts
    @selbstwaerts 5 лет назад

    Sorry, it is me again.
    May I humbly ask, if this is, in essence, NOT a video about GUI?

  • @MccZerk
    @MccZerk 5 лет назад +2

    Dialog is sometimes used instead of window.

  • @DarrenSemotiuk
    @DarrenSemotiuk 5 лет назад +1

    @4:07 :sigh: now I miss my Atari ST GEM Desktop...

  •  5 лет назад +2

    Why are you so visibly uncomfortable in mentioning Linux? You struggle to avoid bringing it into question on this video. Is it because Linux has differing GUI toolkits like GTK+, Qt and wx?

    • @yash1152
      @yash1152 2 года назад

      yeah, i was noticing lack of GNU+linux as well

  • @clifffraser7433
    @clifffraser7433 5 лет назад +4

    Don't you mean "Under the Bonnet".

    • @Ashkenya
      @Ashkenya 5 лет назад

      Bonnet is children's version (explanation) of hood

  • @nicokulmann8398
    @nicokulmann8398 5 лет назад +1

    2:24 @ TJ "Henry" Yoshi

  • @menzelkauliz8571
    @menzelkauliz8571 5 лет назад

    in fact Windows programs have both: a message loop and event handlers for the windows. but most modern solutions burry the message loop deep in the framework and expose only the event handlers to the programmer.

    • @philipfry9436
      @philipfry9436 5 лет назад

      "burry the message loop deep in the framework and expose only the event handlers to the programmer."
      That is because Windows is so poorly designed. Burying like that are work around that flaw.

    • @MrSparker95
      @MrSparker95 5 лет назад

      @@philipfry9436 Could you elaborate why it is poorly designed?

    • @philipfry9436
      @philipfry9436 5 лет назад

      @@MrSparker95 copypasted from my other comment: The window proc stall the thread forever and you have to use co-routine or threads to get around that.

    • @MrSparker95
      @MrSparker95 5 лет назад

      @@philipfry9436 You mean that if YOU stall the message loop by your heavy function then it won't be able to process other messages? Well yes, that's single threaded program design, basicly UI runs in the main thread in Windows. What are alternatives to that?

    • @philipfry9436
      @philipfry9436 5 лет назад +1

      @@MrSparker95 I am not stalling the message pump, it get updated every frame. Drag or resize the window around and it become stalled by Windows (the operating system).
      You need co-routine, threading, or calling your update function from the window proc to work around that. It's a garbage api. There should be only a GetMessage call. No dispatch. Dispatch is widget or application space.

  • @anuj_singh1791
    @anuj_singh1791 5 лет назад +2

    thanks you for such a nice video

  • @JamesSmith-cm7sg
    @JamesSmith-cm7sg 3 года назад

    Surely frameworks handle these things and every Dev isn't writing code for showing part of a window??

    • @davidfrischknecht8261
      @davidfrischknecht8261 3 года назад +1

      If you're developing for Windows and have decided to punish yourself by using plain Win32 APIs, you have to code all the redrawing yourself, unless you're using some built-in controls. Even in that latter case, you still have to tell those controls when to redraw.

  • @MePeterNicholls
    @MePeterNicholls 5 лет назад

    MacOS AN IOS have a responder chain and keeps passing it up until a class wants it. Windows are classes in macOS. As are all UI elements.

    • @PaulaJBean
      @PaulaJBean 5 лет назад

      It's turtles all the way down.

  • @Ubeogesh
    @Ubeogesh 5 лет назад +1

    This is is very helpful knowledge for a software engineer

    • @MladenMijatov
      @MladenMijatov 5 лет назад

      If it were accurate, sure. It's not though. He's not explaining the different roles of compositor and window manager and assumes GUI toolkit does everything, which is not true.

  • @velho6298
    @velho6298 5 лет назад +2

    Nice haircut!

  • @TheUglyGnome
    @TheUglyGnome 5 лет назад +1

    7:45
    NO! You don't use PeekMessage() on message loop. You use GetMessage().

    • @brod515
      @brod515 5 лет назад

      I think you can still use PeekMessage to check for any available messages. but I do understand what you mean

    • @TheUglyGnome
      @TheUglyGnome 5 лет назад

      @@brod515
      Yes you can. But using it as your main message receiving call at message loop results in either busy waiting or unnecessarily complex code (or both).
      Steve's code doesn't work, because he doesn't check if there is message in the queue and therefore tries to translate and dispatch messages which aren't there.

  • @mlfconv
    @mlfconv 4 года назад

    8:58 direct it to a specific window behind...

  • @AttilaAsztalos
    @AttilaAsztalos Год назад

    Window repaint is supposed to be a quintessential NOT MY PROBLEM thing ever since the stone age. Get with the program and use a compositing window manager like, you know, normal people.

  • @SpiritmanProductions
    @SpiritmanProductions 2 года назад +1

    03:57 Windows are called forms, aren't they? 😉

  • @Originalimoc
    @Originalimoc 3 года назад +2

    English caption is awful. Why won't you just enable auto generated one.

    • @atlantic_love
      @atlantic_love 2 года назад

      I just posted the same thing. The English caption is awful in all of his videos. I don't know why.

  • @vkoskiv
    @vkoskiv 5 лет назад +1

    Hello!

  • @thetechnoshed
    @thetechnoshed 5 лет назад

    Ah, looping through WF_NEXTXYWH trying to work out how to draw part of your windows. 'Now you could if you were a lazy programmer redaw everything... and just clip to the area'... Guilty, m'lud.

  • @mikk150
    @mikk150 5 лет назад +3

    Press F to pay respect to wobbly windows on old GNOME desktop

    • @aitchpea6011
      @aitchpea6011 5 лет назад

      I miss my wobbly windows and the fancy alt-tab switchers. All I got now is what's offered by compiz. So, you know, transparency and drop shadows. So boring.

    • @_me-ta-_3780
      @_me-ta-_3780 5 лет назад +1

      @@aitchpea6011 But compiz is what powered the wobbly windows in the first place...

  • @AlRoderick
    @AlRoderick 5 лет назад

    I'm a bit surprised that you said under the hood instead of under the bonnet, was that for the benefit of Americans or do you generally use under the hood in a non-car context? Or do they not call it a bonnet in the UK anymore?

  • @Pianet
    @Pianet 5 лет назад

    Alert boxes and disabling components can be a way of forcing the user to obey your software

    • @SimonzicekCz
      @SimonzicekCz 5 лет назад +1

      And they will break it anyway

  • @SkateTube
    @SkateTube 5 лет назад +1

    source code ?

    • @VBKing2
      @VBKing2 5 лет назад +2

      What source code are you looking for? He is talking about code you don't need to write... the stuff that runs under the hood.

    • @brod515
      @brod515 5 лет назад

      @@VBKing2 hahaha

  • @Roxor128
    @Roxor128 5 лет назад

    This video does a great job of highlighting how "Windows" is a terrible name for a GUI!
    I get that it was 35 years ago, but what were you thinking, Microsoft engineers?

    • @PaulaJBean
      @PaulaJBean 5 лет назад

      Also, 'Excel' should have been named 'Table'.

    • @stoneskull
      @stoneskull 5 лет назад +1

      they made squillions of dollars so it wasn't that bad

    • @philipfry9436
      @philipfry9436 5 лет назад

      Windows always been the name for the screen viewports since the beginning of gui.

    • @YaroKasear
      @YaroKasear 5 лет назад +1

      I think this was back in the day when Microsoft rarely tried to do clever names for most of their products and just named them after what they do. Windows, Office, Disk Operating System...

    • @yash1152
      @yash1152 2 года назад

      @@YaroKasear ahw nice

  • @davesgeekstuff5456
    @davesgeekstuff5456 5 лет назад +1

    Nice RUclips cutout from Dave’s Geek Stuff 😉

  • @PaulaJBean
    @PaulaJBean 5 лет назад +1

    Ah, the good old times when we had to include a message loop in all our programs. Today's kids don't need to know what a WM_PAINT is anymore...

    • @Gnarrrl
      @Gnarrrl 5 лет назад +1

      Ahh, yes yes, WM_ERASEBKGND and WM_PAINT were always such a pleasant boon to productivity!

  • @alecs2056
    @alecs2056 5 лет назад +21

    while(!quit) :/

    • @louiscloete3307
      @louiscloete3307 5 лет назад +4

      I think that was deliberate to help non-programmers understand. It is not obvious what logical not means just out of the word "not" and it is not obvious that "!" means logical not.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 лет назад

      C99 lets you use the words “and”, “or” and “not”. They’re defined in the standard include file iso646.h.

    • @PaulaJBean
      @PaulaJBean 5 лет назад

      I regularly see Python code like: *if flag == True: dosomething* and *if len(s) > 0: dosomething* . That makes me cringe.

    • @Bartosh.S
      @Bartosh.S 5 лет назад +2

      Ratio of time spent reading versus writing is well over 10 to 1. Code readability is more important than saving few bytes.

    • @philipfry9436
      @philipfry9436 5 лет назад

      while(!quit) is perfectly readable. A reason to prefer this form is that global symbols are initialized to zero and therefore is automatic initialized correctly. Perhaps you nooblets should wait to be more experimented with programming before dissing experts.

  • @theonepath7865
    @theonepath7865 5 лет назад +12

    Anyone else tried to program in Java, just given up and moved back to Python or other C family?

    • @virusd900
      @virusd900 5 лет назад +7

      Learned just enough Java to pass my OOP class and never touched it again.

    • @dassumpfhuhn7225
      @dassumpfhuhn7225 5 лет назад +10

      I am the only one that actually likes Java?

    • @alecs2056
      @alecs2056 5 лет назад +5

      Java is a C like language

    • @ximalas
      @ximalas 5 лет назад

      A GUI is pretty concurrent by nature. Try a concurrency oriented programming language. Try Erlang/OTP.

    • @zrobotics
      @zrobotics 5 лет назад +8

      Wait, Python or C family? How on earth is Python C-like at all? Java is strongly influenced by C (semicolons, curly braces, syntax conventions like for loops), but Python isn't even in the same species, let alone family.
      Although I will admit, I've never been a fan of how strictly the language enforces OOP, I much prefer C++ where I can easily drop into straight functional C if I need to, along with the ability to (mis)use pointers.

  • @TheBodgybrothers
    @TheBodgybrothers 5 лет назад +2

    I've always said women can't multitask, they can just handle more events in their single threaded event loop.

  • @jmm1233
    @jmm1233 5 лет назад

    i like ncurses as a gui

    • @MladenMijatov
      @MladenMijatov 5 лет назад

      How can you? I have never managed to write anything without being utterly frustrated.

    • @jmm1233
      @jmm1233 5 лет назад

      @@MladenMijatov i am a little more patient with it , i mean i was going to suggest QT

  • @dakshays6375
    @dakshays6375 5 лет назад

    Please make a video on utility of structures and unions.

  • @Codiac300
    @Codiac300 5 лет назад

    That's a lot of windows

  • @AntneeUK
    @AntneeUK 5 лет назад +4

    Ah, that well known operating system, Atari OS... 🤷‍♂️

    • @edwinschaap5532
      @edwinschaap5532 4 года назад

      AntneeUK It was called TOS. (And the GUI was actually GEM.)

  • @chaoslab
    @chaoslab 5 лет назад +1

    Coding your own GUI's isn't too bad. Not as hard as coding your own IDES (something else I also do).

    • @brod515
      @brod515 5 лет назад +12

      here is your cookie 🍪

    • @PaulaJBean
      @PaulaJBean 5 лет назад +1

      My co-workers always scolded me for using Comic Sans MS as a programming font in my IDE editor, but Comic Sans is making a comeback.

    • @davidgustavsson4000
      @davidgustavsson4000 5 лет назад

      @@PaulaJBean NOOOOOOOOOOOOOOOOOOOOO

    • @yash1152
      @yash1152 2 года назад

      IDEs or IDES??

    • @chaoslab
      @chaoslab 2 года назад

      @@yash1152 IDE's.

  • @SecondShiftPleb
    @SecondShiftPleb 3 года назад

    Anyone know of a good book that addresses gui design from a theory standpoint? Obviously there are a ton of books on specific toolkits and computer graphics, but I'd like one that addresses all of the chaos involved in human-computer interaction; e.g., object-drawing and event handling.

    • @atlantic_love
      @atlantic_love 2 года назад

      There are not a ton of books that specific toolkits, lol.

  • @atlantic_love
    @atlantic_love 2 года назад

    The closed captioning is awful in this video.

  • @theepicslayer7sss101
    @theepicslayer7sss101 5 лет назад

    out of all the things that are special and how a OS works that i know and can make sense of... i really struggle with what happens after you press power and the BIOS appears and how that part works... like i wonder how putting power in a "abacus" is equal a BIOS, even tho i can understand how mathematically the Abacus can make games play in 3d... like why can i Type a letter or a command on the BIOS and why are a set of Characters equal a function... how did they define that in the BIOS?
    so yeah, why do pressing power = seeing a BIOS and being able to type... like you have to define letters some where, you have to define a screen able to display that... an OS cannot do anything without the BIOS having defined that for it before hence how the heck did they make a BIOS without a BIOS?

    • @theepicslayer7sss101
      @theepicslayer7sss101 5 лет назад

      @moo i guess what i mean is, when you press power on, to when you see the BIOS, like what happens to get there.

    • @yash1152
      @yash1152 2 года назад

      @@theepicslayer7sss101 i would guess that bios is like machine code, so basically that data is read and took verbatim by the circuitry in the form of electronic signals, so, highs and lows on voltage, logic gates, transistors and stuff. So, the hardware level stuff rather than some yet another software thing.

  • @MrRobbyvent
    @MrRobbyvent 5 лет назад

    I make a guess now: when You need to redraw a more complicated screen with lot of stuff to put into it they use the GPU to speed things up.

    • @MladenMijatov
      @MladenMijatov 5 лет назад +2

      He failed to explain what compositor is and what's the role of window managers. In properly designed operating systems, not Windows, application will request a buffer from window manager/compositor. This buffer is located on GPU memory. Compositor will then make sure that order of displayed things is correct and redraw only "dirty" parts. Toolkit in turn needs to make sure to update that buffer when window manager requests it to. That way there are no solitaire effect Windows often gets when application stop responding.
      Windows works in a different ways. There system will send bunch of messages to the application window and if there's no response for few seconds you get that not responding message. Among these messages is the repaint request. So if application is not responding nothing will happen and you get solitaire effect. In this repaint message windows will provide a "handle" on to which content will be painted.
      Hardware acceleration is basically where buffers are located and how fast they are painted. If possible compositor will store those buffers on GPU and then create final buffer that will end up being displayed by layering all the application buffers in proper places. Eventually it just tells GPU "display this". When there's no hardware acceleration, all the layering is done on CPU which is not specialized for this kind of operation and ends up being slower.

  • @rokrok-ud1cx
    @rokrok-ud1cx Год назад

    Leonardo Di Caprio's cousin😃

  • @redtail_
    @redtail_ 3 года назад

    other computerphile commenters: Something something CPU something library in C something CSS/JS something something Atari ST GEM something "frames" something shirt compression
    me 15:45 onwards: **scrolling window up and down obsessively** _Ah?! I'm moving an already moving video! This is real-life magic!_

  • @LudwigvanBeethoven2
    @LudwigvanBeethoven2 5 лет назад +3

    Chrome probably keeps drawing of each tab in seperate piece of memory

  • @JustFamilyPlaytime
    @JustFamilyPlaytime 3 года назад +1

    As soon I saw that he had dyed his eyebrows black I thought he was on drugs. And then he said "windows does something better" and I knew he was.

  • @resonance2001
    @resonance2001 5 лет назад +1

    Oh for goodness sake, use a camera tripod! They are cheap

    • @frosty9392
      @frosty9392 5 лет назад

      tripods make videos feel more rigid and tend to drop attention faster
      there is a reason so many movies/shows intentionally avoid stabilization

  • @dharmashlokad
    @dharmashlokad 5 лет назад +2

    Could you please not use a white-board marker on paper ever again? The sound is really annoying.

    • @Teknishun
      @Teknishun 5 лет назад

      They use those in most Computerphile videos. :S

  • @mlfconv
    @mlfconv 4 года назад

    why are you talking about it?

    • @atlantic_love
      @atlantic_love 2 года назад

      That's all he does in his videos, ramble on and on an on, maybe with a little doodling. Just do a quick doodle, explain what we're seeing and then just code, code, code, but I'm not sure he's able to do that.

  • @jscorpio1987
    @jscorpio1987 4 года назад

    7:01 I think he meant command-Q

  • @philipfry9436
    @philipfry9436 5 лет назад +3

    1:50 WTF are you talking about. Windows is garbage. The window proc stall the thread forever and you have to use co-routine or threads to get around that.

    • @colin-campbell
      @colin-campbell 5 лет назад +1

      Philip Fry
      Not strictly speaking true if you know your way around pointer routines.

    • @philipfry9436
      @philipfry9436 5 лет назад

      @@colin-campbell Your solution to the garbageness of windows is to add a hack that call user update function within the window proc?
      We got the operating systems that we deserve...

    • @colin-campbell
      @colin-campbell 5 лет назад +1

      Philip Fry
      You’re close to the solution but overdoing it a little, think about the system in a cleaner fashion.

    • @philipfry9436
      @philipfry9436 5 лет назад

      @@colin-campbell There is no solution. Let alone a clean one. Windows can't be fixed. X11 is _literally_ easier to use.

    • @colin-campbell
      @colin-campbell 5 лет назад +1

      Philip Fry
      There is a solution if you know your way around pointer routines and maybe a little bit of XML injection if you’re not great with pointer routines.

  • @EdwinNoorlander
    @EdwinNoorlander 5 лет назад

    U can call the window, frame.

    • @Grasslehoff
      @Grasslehoff 5 лет назад +3

      the frame is just the outmost container for the content, so you could argue that the frame in itself doesnt really represent the window, rather, as the name suggests, the window frame.

    • @mikejohnstonbob935
      @mikejohnstonbob935 5 лет назад

      that just builds on the window analogy and refer to the frame of the window, then that thing holds multiple "panels"
      window is the whole thing. then the windows GUI has multiple windows hence windows
      macs has multiple baskets which hold apples
      linux has multiple pockets which hold lints

    • @EdwinNoorlander
      @EdwinNoorlander 5 лет назад +1

      The Grasslehoff, the outmost content is most of the time called “Desktop”.
      Most OS’s have multiple desktop frames with multiple window frames.

  • @adama7752
    @adama7752 5 лет назад +1

    This is garbage. Nothing about different ui design (immediate mode vs retrained mode). Different ways of hit testing (color picking, etc... garbage

  • @mandaputtra
    @mandaputtra 5 лет назад

    Friends : I want to pursue CS degree what do you think?
    Me : Just watch computerphile from 0 till end...

  • @selbstwaerts
    @selbstwaerts 5 лет назад

    Nah... is there a lot of elaborate opinion about GUI poured into a basic speech bubble?
    No offense, but please do not do that.