ログウインドウの表示#
Version4.5の場合<widget version="1.0" minimumVersion="3.1" author="Kei's Media Image Lab."> <Settings> <setting name="debug" value="on"/> </Settings>
Version4.0以前の場合
<debug>on</debug>
という行をkonファイルに書き込むと、ウィジェットの起動時にデバッグウインドウが表示されます。
ログウインドウへの出力#
コード上で
print("debug message");
log("time and message");
というコードを書くと、printではメッセージが、logでは時間付きのメッセージが表示されます。
_dump(mainWindow);コード中に上記のようなコードを書くと、以下のようにオブジェクトの中身をありったけダンプさせることができます。 ウィジェットの実行中にも、デバッグウインドウに
/dump(mainWindow)と打ち込むと同じ出力が得られます。
Object "mainWindow":
Dumping object...
alignment: left
attributes: [object DOMNodeMap]
childNodes: [object DOMNodeList]
closed: false
contextMenuItems: undefined
firstChild: [object Image]
hAlign: left
height: 200
hOffset: 983
id:
lastChild: [object TextArea]
level: normal
locked: false
name: mainWindow
nextSibling: [object DOMScriptElement]
nodeName: window
nodeType: 1
nodeValue:
onContextMenu: undefined
onDragDrop: undefined
onDragEnter: undefined
onDragExit: undefined
onFirstDisplay: undefined
onGainFocus: undefined
onKeyDown: undefined
onKeyPress: undefined
onKeyUp: undefined
onLoseFocus: undefined
onMouseDown: undefined
onMouseEnter: undefined
onMouseExit: undefined
onMouseUp: undefined
onMultiClick: function()
onTextInput: undefined
opacity: 100
opacity: 100
opaqueForEvents: false
ownerDocument: [object WidgetDocument]
parentNode: [object YWEWidget]
previousSibling: [object Settings]
root: [object RootView]
shadow: false
style: [object Style]
tagName: window
title: WindowTitle
tooltip:
vAlign: top
visible: true
vOffset: 527
width: 200
zOrder: 0
オブジェクト内オブジェクトのダンプ#
style:[object Style]という出力が得られた場合には
/dump mainWindow.styleのように記述すると、
Object "mainWindow.style":
Dumping object...
background:
backgroundAttachment:
backgroundColor:
backgroundImage:
backgroundPosition:
backgroundRepeat:
color: #000000
fontFamily: sans-serif
fontSize: 12px
fontStretch:
fontStyle: normal
fontWeight: normal
KonBackgroundFill:
KonShadow:
KonShadowColor:
KonShadowOffset:
KonTextTruncation:
opacity:
textAlign: left
textDecoration:
という出力が得られます。
Add new attachment
Only authorized users are allowed to upload new attachments.
«
This page (revision-2) was last changed on 18-Aug-2009 15:19 by kei