当前位置: 首页>>代码示例>>Python>>正文


Python gtk.Adjustment方法代码示例

本文整理汇总了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 
开发者ID:khalim19,项目名称:gimp-plugin-export-layers,代码行数:19,代码来源:presenters_gtk.py

示例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 
开发者ID:khalim19,项目名称:gimp-plugin-export-layers,代码行数:27,代码来源:presenters_gtk.py

示例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) 
开发者ID:ntu-dsi-dcn,项目名称:ntu-dsi-dcn,代码行数:42,代码来源:core.py

示例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) 
开发者ID:khalim19,项目名称:gimp-plugin-export-layers,代码行数:28,代码来源:itembox.py

示例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) 
开发者ID:KTH,项目名称:royal-chaos,代码行数:48,代码来源:core.py

示例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() 
开发者ID:khalim19,项目名称:gimp-plugin-export-layers,代码行数:53,代码来源:parasitebox.py


注:本文中的gtk.Adjustment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。