📜  PyGTK-范围类

📅  最后修改于: 2020-11-08 07:53:33             🧑  作者: Mango


此类充当小部件的基类,这些小部件使用户可以在上下限之间调整数字参数的值。比例小部件(gtk.Hscale和gtk.Vscale)和滚动条小部件(gtk.HScrollbar和gtk.VScrollbar)从Range类派生功能。这些范围小部件与Adjustment对象一起使用。

gtk.Range类的以下重要功能由Scale和Scrollbar小部件实现-

  • set_update_policy() -将“ update-policy”属性设置为该值。该策略具有以下值-

gtk.UPDATE_CONTINUOUS anytime the range slider is moved, the range value will change and the “value_changed” signal will be emitted.
gtk.UPDATE_DELAYED the value will be updated after a brief timeout where no slider motion occurs, so value changes are delayed slightly rather than continuously updated.
gtk.UPDATE_DISCONTINUOUS the value will only be updated when the user releases the button and ends the slider drag operation.
  • set_adjustment() -设置“ adjustment”属性。调整对象用作范围对象的模型。

  • set_increments() -设置范围的步长和页面大小。

  • set_range() -设置范围小部件的最小和最大允许值

  • set_value() -将范围的当前值设置为指定的值。

比例小部件类-(HScale和VScale)从gtk.Range类派生。