• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

WPF Dispatcher

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #21
    Originally posted by AtW View Post
    GUI update function in underlieing object can be called by the Timer thread which is ok to change GUI, so if you want you can keep your GUI update implementation inside your classes.
    Yes that part's fine, it's the whole "run a loop to see what's changed" aspect that seems to totally fly in the face of how a GUI app should work... though to be fair an update loop is not that unusual when coders can't find how to make the GUI behave as it should.
    Originally posted by MaryPoppins
    I'd still not breastfeed a nazi
    Originally posted by vetran
    Urine is quite nourishing

    Comment


      #22
      Originally posted by d000hg View Post
      Yes that part's fine, it's the whole "run a loop to see what's changed"
      Eh? Timer calls function that updates GUI elements, it can call actual class functions who know how to do it, only this happens on the GUI thread so no issues. Also function can be smart enough to only update visible components or changed values, trivial to do.

      I've written games long time ago and one lesson I learnt early on was that redrawing whole lot is faster in reality than trying to be too smart - these days even low end computers have powerful graphics accelerators and Windows is smart enough to avoid updating invisible elements.

      It should have been possible to have multi-threaded access to GUI - the fact that Microsoft still did not manage to implement it in a clean new project (.NET) is pathetic, but then again the whole of WinForms was poorly designed and WPF seems rather too heavy.

      I am actually planing to do more GUI work soon, and still can't decide whether I should stick with rather pathetic WinForms or take huge risk with WPF.

      Comment


        #23
        Originally posted by AtW View Post
        Eh? Timer calls function that updates GUI elements, it can call actual class functions who know how to do it, only this happens on the GUI thread so no issues. Also function can be smart enough to only update visible components or changed values, trivial to do.

        I've written games long time ago and one lesson I learnt early on was that redrawing whole lot is faster in reality than trying to be too smart - these days even low end computers have powerful graphics accelerators and Windows is smart enough to avoid updating invisible elements.

        It should have been possible to have multi-threaded access to GUI - the fact that Microsoft still did not manage to implement it in a clean new project (.NET) is pathetic, but then again the whole of WinForms was poorly designed and WPF seems rather too heavy.

        I am actually planing to do more GUI work soon, and still can't decide whether I should stick with rather pathetic WinForms or take huge risk with WPF.
        Oh go with WPF, it's wicked man.
        Knock first as I might be balancing my chakras.

        Comment


          #24
          Originally posted by suityou01 View Post
          I had just not realised what a c<nt WPF is when it comes to handling this tulip. I fully agree with ATW that each object should have a better implementation of cross thread chat for something as simple as updating a label caption FFS.

          Praps

          MyBstardLabel.Caption.UpdateByDispatcher(Value)

          I dunno but would cut out a lot of the ball ache.
          I dunno but I expect updating that label via the dispatcher or the backgroundworker would have been a lot simpler than spending the time creating that post. Possibly the most frustrating thing about programming at all is the amount of time some people will spend discussing why they shouldn't change 5 lines of their code as opposed to just doing it!

          Comment


            #25
            Originally posted by AtW View Post
            Eh? Timer calls function that updates GUI elements, it can call actual class functions who know how to do it, only this happens on the GUI thread so no issues. Also function can be smart enough to only update visible components or changed values, trivial to do.
            I am not talking about it being difficult. I am saying a polling loop to update GUI from state (which is what using a timer achieves) is fundamentally a bad design in a Windows GUI application.
            Originally posted by MaryPoppins
            I'd still not breastfeed a nazi
            Originally posted by vetran
            Urine is quite nourishing

            Comment


              #26
              Originally posted by d000hg View Post
              I am not talking about it being difficult. I am saying a polling loop to update GUI from state (which is what using a timer achieves) is fundamentally a bad design in a Windows GUI application.
              It's not great, but I'd say much more fundamentally bad design of Windows GUI is its inability (in .NET) to get updated easily from threads other than main GUI thread.

              Comment


                #27
                So this tulip is still a part of windows development in .NET?

                I only recently had the pleasure of this 'updating the GUI on differnet threads' bollox on an old winforms app. I thought that WPF would have solved this. Huh.

                I'll stick with ASP.NET then as this seems to have it abstracted away

                Comment


                  #28
                  Originally posted by Shimano105 View Post
                  I only recently had the pleasure of this 'updating the GUI on differnet threads' bollox on an old winforms app. I thought that WPF would have solved this. Huh.
                  I suspect this tulip is still part of Win32 API, though I've never programmed it deep enough to be sure.

                  The whole GUI part of .NET is very poorly done. Good thing I don't have to use it much...

                  Comment


                    #29
                    Originally posted by Shimano105 View Post
                    So this tulip is still a part of windows development in .NET?

                    I only recently had the pleasure of this 'updating the GUI on differnet threads' bollox on an old winforms app. I thought that WPF would have solved this. Huh.

                    I'll stick with ASP.NET then as this seems to have it abstracted away
                    From what I've seen regarding WPF the idea is to use the Model-View-ViewModel pattern and rely on data binding to update your GUI rather than updating it imperatively.

                    Comment

                    Working...
                    X