我在TornadoFX公司工作
fragment
类,并打开每个新的
碎片
在新窗口中使用它的
openWindow()
窗户打开了,一切正常。我已将模式设置为
Modality.NONE
因此,当新片段处于活动状态时,可以访问原始屏幕。
总是
在顶部,所以我必须移动它以访问下面的原始窗口,这并不理想。
这是故意的吗/是否有任何方法可以改变这种行为?
我一直在和你玩
s
owner =
参数,将其设置为null和另一个
Stage
但似乎什么都不管用。
首先,打开窗口的代码,
view
//h here is just the histogram, an int[]
val hisScope = HistogramScope(h, pointerVM.APUFile.file.name)
//view declared using the find method.
val view = find<Histogram>(hisScope)
view.whenUndocked {
closeChart(pointerVM)
}
//code checks to see if the requested histogram is already open
val matchingRnameHistograms = isMatchingRnameOpen(pointerVM)
if (map.size == 0 || matchingRnameHistograms.isEmpty()) {
view.openWindow(stageStyle = StageStyle.UTILITY, modality = Modality.NONE, resizable = false, owner = null, block = false)
map.put(pointerVM, view) //record which histograms are open
} else { //.. not too relevant }
接下来,我是如何声明具有作用域的片段的:
class Histogram : Fragment() {
override val scope = super.scope as HistogramScope
override val root = hbox{
hgrow = Priority.ALWAYS
vgrow = Priority.ALWAYS
style{
minWidth = 1280.px
minHeight = 250.px
}
}
提前谢谢!