本文整理汇总了Python中gtk.Adjustment方法的典型用法代码示例。如果您正苦于以下问题:Python gtk.Adjustment方法的具体用法?Python gtk.Adjustment怎么用?Python gtk.Adjustment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk
的用法示例。
在下文中一共展示了gtk.Adjustment方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _create_gui_element
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Adjustment [as 别名]
def _create_gui_element(self, setting):
display_id = getattr(setting.value, "ID", 0)
spin_button = gtk.SpinButton(
gtk.Adjustment(
value=display_id,
lower=0,
upper=2**32,
step_incr=1,
page_incr=10,
),
digits=0)
spin_button.set_numeric(True)
spin_button.set_value(display_id)
return spin_button
示例2: _create_spin_button
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Adjustment [as 别名]
def _create_spin_button(setting, digits=0):
if hasattr(setting, "min_value") and setting.min_value is not None:
min_value = setting.min_value
else:
min_value = -2**32
if hasattr(setting, "max_value") and setting.max_value is not None:
max_value = setting.max_value
else:
max_value = 2**32
spin_button = gtk.SpinButton(
gtk.Adjustment(
value=setting.value,
lower=min_value,
upper=max_value,
step_incr=1,
page_incr=10,
),
digits=digits)
spin_button.set_numeric(True)
spin_button.set_value(setting.value)
return spin_button
示例3: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Adjustment [as 别名]
def __init__(self):
assert Visualizer.INSTANCE is None
Visualizer.INSTANCE = self
super(Visualizer, self).__init__()
self.nodes = {} # node index -> Node
self.channels = {} # id(ns3.Channel) -> Channel
self.window = None # toplevel window
self.canvas = None # goocanvas.Canvas
self.time_label = None # gtk.Label
self.play_button = None # gtk.ToggleButton
self.zoom = None # gtk.Adjustment
self._scrolled_window = None # gtk.ScrolledWindow
self.links_group = goocanvas.Group()
self.channels_group = goocanvas.Group()
self.nodes_group = goocanvas.Group()
self._update_timeout_id = None
self.simulation = SimulationThread(self)
self.selected_node = None # node currently selected
self.speed = 1.0
self.information_windows = []
self._transmission_arrows = []
self._last_transmissions = []
self._drop_arrows = []
self._last_drops = []
self._show_transmissions_mode = None
self.set_show_transmissions_mode(ShowTransmissionsMode.ALL)
self._panning_state = None
self.node_size_adjustment = None
self.transmissions_smoothing_adjustment = None
self.sample_period = SAMPLE_PERIOD
self.node_drag_state = None
self.follow_node = None
self.shell_window = None
self.create_gui()
for plugin in plugins:
plugin(self)
示例4: _init_gui
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Adjustment [as 别名]
def _init_gui(self):
self._size_spin_button = gtk.SpinButton(
gtk.Adjustment(
value=0,
lower=self._min_size,
upper=self._max_size,
step_incr=1,
page_incr=10,
),
digits=0)
self._size_spin_button.set_numeric(True)
self._size_spin_button.set_value(0)
self._size_spin_button_label = gtk.Label(_("Size"))
self._size_hbox = gtk.HBox()
self._size_hbox.set_spacing(self._SIZE_HBOX_SPACING)
self._size_hbox.pack_start(self._size_spin_button_label, expand=False, fill=False)
self._size_hbox.pack_start(self._size_spin_button, expand=False, fill=False)
self._vbox.pack_start(self._size_hbox, expand=False, fill=False)
self._vbox.reorder_child(self._size_hbox, 0)
self._size_spin_button.connect(
"value-changed", self._on_size_spin_button_value_changed)
示例5: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Adjustment [as 别名]
def __init__(self):
"""!
Initializer function.
@param self: class object.
@return none
"""
assert Visualizer.INSTANCE is None
Visualizer.INSTANCE = self
super(Visualizer, self).__init__()
self.nodes = {} # node index -> Node
self.channels = {} # id(ns3.Channel) -> Channel
self.window = None # toplevel window
self.canvas = None # goocanvas.Canvas
self.time_label = None # gtk.Label
self.play_button = None # gtk.ToggleButton
self.zoom = None # gtk.Adjustment
self._scrolled_window = None # gtk.ScrolledWindow
self.links_group = goocanvas.Group()
self.channels_group = goocanvas.Group()
self.nodes_group = goocanvas.Group()
self._update_timeout_id = None
self.simulation = SimulationThread(self)
self.selected_node = None # node currently selected
self.speed = 1.0
self.information_windows = []
self._transmission_arrows = []
self._last_transmissions = []
self._drop_arrows = []
self._last_drops = []
self._show_transmissions_mode = None
self.set_show_transmissions_mode(ShowTransmissionsMode.ALL)
self._panning_state = None
self.node_size_adjustment = None
self.transmissions_smoothing_adjustment = None
self.sample_period = SAMPLE_PERIOD
self.node_drag_state = None
self.follow_node = None
self.shell_window = None
self.create_gui()
for plugin in plugins:
plugin(self)
示例6: _init_gui
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Adjustment [as 别名]
def _init_gui(self, parasite):
self._parasite_name_entry = gtk.Entry()
self._parasite_flags_spin_button = gtk.SpinButton(
gtk.Adjustment(
value=parasite.flags,
lower=0,
upper=2**32,
step_incr=1,
page_incr=10,
),
digits=0)
self._parasite_flags_spin_button.set_numeric(True)
self._parasite_data_entry = gtk.Entry()
self._vbox_name_label = gtk.Label(
_("Name").encode(pgconstants.GTK_CHARACTER_ENCODING))
self._vbox_name_label.set_alignment(0.0, 0.5)
self._vbox_name = gtk.VBox()
self._vbox_name.set_spacing(self._VBOX_SPACING)
self._vbox_name.pack_start(self._vbox_name_label, expand=False, fill=False)
self._vbox_name.pack_start(self._parasite_name_entry, expand=False, fill=False)
self._vbox_flags_label = gtk.Label(
_("Flags").encode(pgconstants.GTK_CHARACTER_ENCODING))
self._vbox_flags_label.set_alignment(0.0, 0.5)
self._vbox_flags = gtk.VBox()
self._vbox_flags.set_spacing(self._VBOX_SPACING)
self._vbox_flags.pack_start(self._vbox_flags_label, expand=False, fill=False)
self._vbox_flags.pack_start(
self._parasite_flags_spin_button, expand=False, fill=False)
self._vbox_data_label = gtk.Label(
_("Data").encode(pgconstants.GTK_CHARACTER_ENCODING))
self._vbox_data_label.set_alignment(0.0, 0.5)
self._vbox_data = gtk.VBox()
self._vbox_data.set_spacing(self._VBOX_SPACING)
self._vbox_data.pack_start(self._vbox_data_label, expand=False, fill=False)
self._vbox_data.pack_start(self._parasite_data_entry, expand=False, fill=False)
self.set_spacing(self._HBOX_SPACING)
self.pack_start(self._vbox_name, expand=False, fill=False)
self.pack_start(self._vbox_flags, expand=False, fill=False)
self.pack_start(self._vbox_data, expand=False, fill=False)
self._set_values(parasite)
self._connect_changed_events()