Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
KDE GUI

Developing Applications with KJSEmbed 25

Rich writes "Ian Geiser of SourceXtreme has released an interesting HOWTO showing how you can use KDE's embedded JavaScript tool to write quick-and-dirty apps. The apps can use the features of Qt and KDE to pack a lot of punch for a small amount of code. You can find it on his website."
This discussion has been archived. No new comments can be posted.

Developing Applications with KJSEmbed

Comments Filter:
  • Not trolling... (Score:4, Interesting)

    by byolinux ( 535260 ) on Thursday April 08, 2004 @10:48AM (#8803436) Journal
    All this is fine, but really what Free Software needs is a tool like Visual Basic (the later versions) that

    a) works
    2) can take VB and convert
    d) can compile nicely to multiple architectures.

    As far as I know, nothing like this is available for GNU/Linux. The nearest thing I know like this, is RealBasic for Mac - now can produce binaries for X86, but it's not free.
    • Re:Not trolling... (Score:4, Interesting)

      by black mariah ( 654971 ) on Thursday April 08, 2004 @11:31AM (#8803927)
      Gambas (http://gambas.sf.net) is moving along at a nice clip. It's a VB-ish and simple enough that even a mega-lame coder wannabe like me can create some useful stuff. Currently compilation and running of programs is... iffy. Unless you have Gambas installed you're not going to be running any programs created by it on your computer, but it's a strong base for someone to jump in and add the features you're talking about.
    • by mhesseltine ( 541806 ) on Thursday April 08, 2004 @11:31AM (#8803930) Homepage Journal
      a) works

      2) can take VB and convert
      d) can compile nicely to multiple architectures.

      Does VB have an enumerator that counts a,2,d?

    • Re:Not trolling... (Score:2, Insightful)

      by Viol8 ( 599362 )
      Most unix apps arn't event driven (or even GUI) so an event driven language like VB (ok i know it can be non event driven but thats not its raison
      d'etre) is not much use as an all purpose solution. Tcl/Tk was good at this sort of thing but it seems to have gone below the radar in the last 5 years or so.
    • Re:Not trolling... (Score:3, Insightful)

      by Brandybuck ( 704397 )
      Well if it weren't for the requirement "can take VB and convert", you would have a lot of options. VB needs to go away. People didn't use VB because of the language, they used it because you could write crappy throwaway programs and prototypes quickly. Using Python, Perl, Ruby, Delphi, Java and or even C++ underneath makes no difference, because 99% of the time the RAD developer isn't touching any code.

      Frankly, the whole "programming for non-programmers" approach needs to be seriously rethought. It's good
  • interface scripting (Score:5, Interesting)

    by OmniVector ( 569062 ) <see my homepage> on Thursday April 08, 2004 @11:17AM (#8803760) Homepage
    I wish someone in linux would implement a system that mimics the functionality of apple script. before people go off flaming me, let me explain for those who don't know what it does. apple script basically lets you set hooks in the program in a standard way so that anyone can script an application by manipulating objects in the program. the program registers with the applescript by giving it a list of all the objects it has and the methods these objects have that you can call on them. it's a very clean interface, and requries little extra work from the developers (which is nice). even if this does exist for KDE/gnome.. it's under documented, or no one uses it!
    • by Rich ( 9681 ) on Thursday April 08, 2004 @11:30AM (#8803919) Homepage
      It's called DCOP and it's used a lot. Here's one of several tutorial on the subject: IBM tutorial [ibm.com]. Note that Ian is planning a tutorial showing how you can use DCOP from KJSEmbed in this series too.
      • by Simon ( 815 ) <simon@simonz o n e . com> on Thursday April 08, 2004 @12:02PM (#8804298) Homepage
        The current problems with using DCOP right now for scripting and macros type stuff are:

        * There is very little documentation about what DCOP interfaces programs like Kate have, and how they can be used for writing small scripts and macros.

        * The existing DCOP interfaces are not designed for the ease of use by scripters/powerusers. They are built directly on top of the C++ implementation.

        * The DCOP interfaces are often not complete enough to make it possible to script everything that can be done via the GUI.

        --
        Simon
        • There is very little documentation about what DCOP interfaces programs like Kate have, and how they can be used for writing small scripts and macros.

          I just figured this out by typing 'dcop kate' and then looking at what was printed.

          $ dcop kate KateDocumentManager openURL /etc/passwd ''
          DCOPRef(kate, KateDocument#3)
          $ dcop kate EditInterface#3 numLines
          61
          $ dcop kate EditInterface#3 insertLine 61 blah
          true

          Wasn't that hard, really. I do know what a DCOPRef is though, so I had a head start. My point is that yo

    • by Anonymous Coward
      And what's really nifty is that all of that is done via OSA, the Open Scripting Architecture. So if you don't feel like coding in applescript, you can access all those same hooks with any other scripting language that has an OSA implementation (javascript, perl, python, etc...)
    • Also, note that apps which are formally applescript supported export a "Dictionary" which allows you to see the applescript "API" ( grammer would be a better term ).

      That, alone, makes applescript really f*cking fantastic.
  • Ok I don't use KDE (or Gnome for that matter) because of their bloated size. This probably goes someway to explaining why they're such monstrosities. I'm sure some KDE fanatic moderator
    will mod me down for this but all I want from a window manager (don't give me this "its an enviroment crud") is to display windows. I want the apps to do what I need , NOT the code running
    the eye candy around them.
    • by stilborne ( 85590 ) on Thursday April 08, 2004 @01:56PM (#8805748)
      Javascript is not embedded in KDE. KJSEmbed is a set of Javascript bindings built on top of KDE Javascript implementation. this is no different than, say, Python or Java bindings. where it does deviate is that it is possible for an application to embed the KJS engine and thereby use KJSEmbed internally as a scripting option should it so choose. but it isn't like KJSEmbed is loaded whenever you start up KDE, or even the overwhelming majority of KDE apps for that matter.

      that said, one of the beautiful things about open source / Free software is choice. go crazy with your window manager only set up, and have fun with it! i'm glad you aren't forced to use something that doesn't fit your style and/or needs!

      all the same, it's only fair to be accurate. your viewpoint on "eye candy" derivative code trying to do "what you need" rather than the apps themselves is a rather inaccurate statement on how things work. desktop environments aren't for everyone (you being an example of that), but at least you could get your derision right ;-)
    • by Jerk City Troll ( 661616 ) on Thursday April 08, 2004 @02:44PM (#8806440) Homepage

      If you hate it so much, then don't use it.

      I can't stand it when people bitch and moan about a some technology being too <negative_adjective> when it comes to open source. (Especially when people like you make complaints and don't even bother to substantiate them in any way. What you offer is purely opinion.) If you're in a position to use KDE, then you are not using Windows. If you are not using Windows, then you are in a position of choice.

      And that's really the whole point, isn't it?

      KDE is a desktop environment, not a window manager like you are asking for. In this case, KDE is trying to provide a platform that is both easy to use and serves the needs of rapid application development. These are things that will help make it a more viable alternative to Windows and tools like VisualBASIC which can be great for quick prototyping. Of course, I don't know what the point is of defending it on these grounds. It's a tool, one of many, well suited to certain tasks and perhaps not so well suited to others.

    • by nurb432 ( 527695 ) on Thursday April 08, 2004 @08:44PM (#8810774) Homepage Journal
      Its a complete desktop environment, with all the features, libraries, intercommunications, coding standards, and all bells and whistles that go along with an 'environment'.

      If you just want a window manager, then KDE isn't your best choice in the first place...

      Please try to compare apples to apples...
  • I'm using the less extravagant version, Qt+QSA which is the core of this framework. We're using it because we're embedded and need the space so we can't have KDE on there. We get crossplatform architecture independence. We don't need to know or care about what the target processor is. And we can link it into our existing MFC app.

    I can say that it is quite impressive. It can replace wxPython, and even Mozilla and Java for application development.

    In the future my home projects will be done in KJSEmbed just

The opposite of a correct statement is a false statement. But the opposite of a profound truth may well be another profound truth. -- Niels Bohr

Working...