我有显示VScale的代码。小部件显示一个指示当前值的数字。它通过更改值来响应分页事件。但是,没有slider.There只是一个小圈子。如何让它正确显示,以便用户可以通过拖动滑块来调整该值?

下面是我的代码:
class ThresholdingWindow(SuperClass):
def __init__(self, parent, controller):
super(ThresholdingWindow, self).__init__(parent, controller)
self.set_title("Thresholding")
self.controller = controller
button = Gtk.Button.new_with_label("Apply")
self.box.pack_start(button, True, True, 0)
button2 = Gtk.Button.new_with_label("Back to Main")
button2.connect("clicked", self.on_back_clicked)
self.box.pack_start(button2, True, True, 0)
adjustment = Gtk.Adjustment(0.0,0.0,1.0,.01,.02)
# scale = Gtk.Scale.new(Gtk.Orientation.VERTICAL, adjustment)
scale = Gtk.VScale.new(adjustment)
scale.set_digits(3)
# scale = Gtk.VScale(adjustment)
self.box.pack_start(scale, False, False,0)发布于 2021-02-21 01:57:55
在stackoverflow上找到:
scale.set_size_request(30,100)看起来屏幕上没有足够的“空间”来容纳滑块。
https://stackoverflow.com/questions/66294450
复制相似问题