Go Back   OpenLaszlo Developers Forums > Non-programming help and discussions > Development Tools and Practices

Development Tools and Practices Questions about development tools and practices. An appropriate place to talk about text editors, IDEs, and anything else that makes your development life easier.

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-11-2003, 11:24 AM
Anne
Guest
 
Posts: n/a
Lightbulb Tip of the Week: Using the Debugger

Hi all

You may have seen the debugger, and wondered about its use. It doesn't take long to figure out that it can be written to as follows:

Debug.write( 'Hello, World!' );

But did you know about its hidden talents? Consider the code below:

Code:
<canvas debug="true">
    <view name="myView"
          width="50" height="50"
          bgcolor="red"
          x="120" y="45" />
    <text name="myTextView"
          x="90" y="75">Hello, Laszlo!</text>
</canvas>
You can access elements from within the debugger. Try typing:

canvas.myView

Into the text input field of the debugger while the app is running in the browser. Hit the enter key, or click "Eval". That doesn't do much, but you can see that it recognized the view "myView". Now try getting an attribute of that view:

canvas.myView.x
>>> 120

You don't need to use getAttribute() in the debugger; it assumes that's what you want. You can manipulate views too (now you have to use setAttribute()):

canvas.myView.setAttribute( 'x', 160 )

You can execute arbitrary code too, to explore how the LZX scripting language works:

2 + 2
>>> 4

Have fun!


Antun Karlovac
Reply With Quote
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
destroy() and warnings of null setters in the debugger jimkfoster General OpenLaszlo Programming 2 09-19-2007 11:09 AM
Calling functions from Debugger doesn't work on linux trucker_ General Help 13 06-20-2007 03:52 AM
Application is running with Debugger, but not without it?!? TheSmile OpenLaszlo Debugging 4 03-09-2007 01:08 AM
Positioning the debugger antun Development Tools and Practices 3 08-31-2005 03:41 AM
How do you make drop shadows on windows, like the debugger hqm Visual Design 0 01-21-2003 03:37 PM


All times are GMT -8. The time now is 07:24 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.