Button對最近的對象的操作你好,
創建多個分析對象並在每個分析對象附近放置按鈕的最佳方法是什麼?
該按鈕將對相關對象執行某些操作。
我不想使用對變量的引用,但有些關鍵字如“this / parent”等。
例:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New window("Window",
VlistBox(
hlistbox(Distribution( Column( :weight ) ),Button Box("Remove Box Plot")),
hlistbox(Distribution( Column( :height ) ),Button Box("Remove Box Plot")),
)
);
謝謝。
湯姆。
Re:Button對最近的對象的動作非常感謝你。你的答案非常有幫助。Re:Button對最近的對象的動作很酷的問題和答案是肯定的。 學到了一些新知識,因為我對自己的答案很好奇。 我是這樣做的:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
bbFunc = Function({this},
dist_ob = ((this << parent) << child) << Get Scriptable Object();
dist_ob << Outlier Box Plot( 0 );
);
New Window( "Window",
V List Box(
H List Box( Distribution( Column( :weight ) ), Button Box( "Remove Box Plot" , << Set Function(bbFunc)) ),
H List Box( Distribution( Column( :height ) ), Button Box( "Remove Box Plot" , << Set Function(bbFunc)) )
)
);使用<< Set Function消息而不是僅僅將bbFunc作為secondond參數是至關重要的。 它不起作用。 我找到了在Set Function下的腳本索引中使用“this”的示例。