Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

KJSEmbed::JSConsoleWidget Class Reference

A QWidget that provides a console for executing Javascript commands. More...

#include <jsconsolewidget.h>

Inheritance diagram for KJSEmbed::JSConsoleWidget::

QFrame QWidget QObject List of all members.

Public Slots

void execute ()
virtual bool execute (const QString &cmd)
virtual void println (const QString &text)
virtual void warn (const QString &text)
virtual bool run (const QString &shellCmd)

Public Methods

 JSConsoleWidget (KJS::Interpreter *js, QWidget *parent=0, const char *name=0)
virtual ~JSConsoleWidget ()
KJS::Interpreter * jscript () const
QTextEdit * messages () const
KPopupTitle * title () const

Protected Methods

void createView ()
void childExited ()
void receivedStdOutput (KProcess *, char *, int)
void receivedStdError (KProcess *, char *, int)

Detailed Description

A QWidget that provides a console for executing Javascript commands.

Creating a JS console is easy, as you can see below:

   KJS::Object global( new KJS::ObjectImp() );
   KJS::Interpreter *js = new KJS::Interpreter( global );
   KJSEmbed::JSConsoleWidget *win = new KJSEmbed::JSConsoleWidget( js );
   win->addBindings( js->globalExec(), global );
 

This example creates a console for a JS interpreter and adds a print function to the interpreter.

Version:
Id:
jsconsolewidget.h,v 1.6 2003/01/15 03:34:34 rich Exp
Author:
Richard Moore, rich@kde.org


The documentation for this class was generated from the following file:
Generated at Sat Feb 1 03:23:35 2003 for KJSEmbed by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001