Loading ...
Sorry, an error occurred while loading the content.

MengWin

Expand Messages
  • Marcus Engene
    Hi list, I don t like web-programming but now I ve sort of stumbled into it. My views of it is cynical and very naive. Please have that in mind when reading
    Message 1 of 3 , Apr 9, 2006
    • 0 Attachment
      Hi list,

      I don't like web-programming but now I've sort of stumbled into it.
      My views of it is cynical and very naive. Please have that in mind
      when reading this.

      Doing simple stuff in php is one thing, but now that the web is moving
      into webX.Y there will be some difference. To me it's not about new
      technologies, it's about what we've got has matured enough to
      formalize frameworks around it.

      Doing complex web-pages, I don't want to be bothered with stupid
      details; I want to focus on the functionality. Java, C++, .Net etc
      programmers have had this luxury for quite some time now.

      Doing C++ GUI programming I like the wxWidgets framework. It is
      basically a wrapper around the native widgets of a platform (eg
      X/framebuffer, X/Gtk, Mac OSX, MS Windows, ...) but with a
      consistant interface. It has been ported
      to several other languages as well. During my tests I've f.ex
      looked at wxGlade-generated Python code as that's closer to
      JS than C++ (no macros!).

      I've played a little with trying to mimic wxWidgets in JS under
      YUI. I've been thinking of this for some time now but never got
      around to it.

      There are many advantages to do this.
      * A gui builder (f.ex wxglade.sf.net) could be ported and the
      layout of a web-app could be done the same way as a Java guy does.
      * wxw provides excellent documentation and has a good book.
      We don't have to redo their mistakes (not all of them anyway)
      and we have a blueprint of what needs to be done.
      * There is already a large number of programmers familiar with it.
      * Functionality is separated from layout making cleaner code (see CSS)
      clean correlates to maintainable. 1000 lines of crap code is
      maintainable, 100000 lines are not.

      wxw Example.
      The normal way of doing a simple wxw application is to subclass wxFrame.
      wxFrame is a window, basically.

      In the constructor you create the widgets (gui elements: buttons, sliders,
      textareas etc; "the things you put in <form />")

      Then you layout the widgets with sizers (classes derived from wxSizer).

      Add callbacks from certain events of certain widgets to code in your
      wxFrame subclass. Fex, onlick on "ok" button, call this function.

      Instantiate your object.
      If you want to poke on data in it, do so now.
      call instance.Show(true) to show it.
      done

      From a spaghetti web pov there are several things we notice.
      * The widgets of a wxFrame operates (usually) on variables in its
      own instance. No variable conflict with other instances.
      * We tell the sizers how to layout and let them bother with
      (X/Gtk, windows, Mac) or in this case (IE, FF, Opera, ...).
      * We reuse classes to get other behavior, f.ex by subclassing and
      override or add functions.
      * Id's are generated dynamically and we don't have to bother with it.

      From what I could see of other web libraries (including YUI) is that
      they seem to provide some cool widgets you can integrate to your site.
      I want it the other way around, to have a framework which i _easily_
      can adapt to my needs (as my needs can and will change in different
      projects).

      Early tests are here:
      http://www.engene.se/mengwin

      Note that I put it in YAHOO.framework namespace since I didn't think
      it would make sense elsewhere. So, add that in your YAHOO.js if you
      want to play with it.

      Before I waste too much time with this, I wonder
      * This is the most important question right now:
      Is there an existing thing doing this? I do this because I want to
      use this; I'm too pragmatic to waste time on it if there is such a
      tool already.
      * I'm not a brilliant JS programmer, have I done any obvious mistakes?
      (I'm aware of prototype.js existance and the shadow is going away)
      * Thoughts about it in general. If it sucks please tell me! and why.
      * Would the Yahoo guys accept the namespace addition?
      * Are there others interrested in programming on it a bit later on when
      the API style/handwriting/.. is set?
      Right now I use wxGlade to layout simple windows and try to make
      MengWin behave the same.

      NOTE, a window here is a <div> which floats. It is ofcourse possible to
      not have it to float, but to go into the page instead. The button menu
      is one example of this.

      Best regards,
      Marcus
    • Charles
      Marcus, Your demos are interesting. I can imagine that wxWidgets developers looking to duplicate the desktop metaphor on the web would be especially interested
      Message 2 of 3 , Apr 9, 2006
      • 0 Attachment

        Marcus,

         

        Your demos are interesting. I can imagine that wxWidgets developers looking to duplicate the desktop metaphor on the web would be especially interested in these.

         

        IMHO there are lots of potential negatives to co-opting the YUI namespace. I’d prefer that you created your own namespace.

         

        There are lots of frameworks for web development (some are cataloged at MVC frameworks for PHP), and many of them have a presentation-layer aspect. More research might help you decide whether it makes more sense to start a new framework or to team up on existing project.

         

        — Charles

         


        From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of Marcus Engene
        Sent: Sunday, April 09, 2006 5:12 AM
        To: ydn-javascript@yahoogroups.com
        Subject: [ydn-javascript] MengWin

         

        Hi list,

        I don't like web-programming but now I've sort of stumbled into it.
        My views of it is cynical and very naive. Please have that in mind
        when reading this.

        Doing simple stuff in php is one thing, but now that the web is moving
        into webX.Y there will be some difference. To me it's not about new
        technologies, it's about what we've got has matured enough to
        formalize frameworks around it.

      • Philip Tellis
        ... Anyone who wants to build an MVC framework in PHP should first read Rasmus The no-framework PHP MVC framework
        Message 3 of 3 , Apr 9, 2006
        • 0 Attachment
          Sometime Today, C cobbled together some glyphs to say:

          > There are lots of frameworks for web development (some are cataloged
          > at MVC frameworks for PHP <http://www.phpwact.org/php/mvc_frameworks>
          > ), and many of them have a presentation-layer aspect. More research

          Anyone who wants to build an MVC framework in PHP should first read
          Rasmus' "The no-framework PHP MVC framework"

          http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html

          Philip

          --
          PL/I -- "the fatal disease" -- belongs more to the problem set than to the
          solution set.
          -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5



          Journal: http://www.livejournal.com/users/bluesmoon/

          MSN philiptellis Yahoo! philiptellis
          AIM philiptellis
        Your message has been successfully submitted and would be delivered to recipients shortly.