def add_scale_widget(self, prop, enforce_range=True): # Create the widget: inp = ScaleEntry(prop.minimum, prop.maximum, enforce_range=enforce_range) inp.set_tooltip_text(prop.title) self[self.widget_format % prop.label] = inp # Add & return the widget return self._add_widget_to_container(inp, self._get_widget_container(prop))
def create_inputs(table): input_widgets = [None] * N check_widgets = [None] * N num_columns = 2 column_width = 3 for i, prop in enumerate(self.props): new_lbl = self.create_mathtext_widget(prop.math_title, prop.label) new_inp = ScaleEntry(lower=prop.minimum, upper=prop.maximum, enforce_range=True) new_inp.set_tooltip_text(prop.title) new_inp.set_name(self.widget_format % prop.label) self[self.widget_format % prop.label] = new_inp input_widgets[i] = new_inp j = (i % num_columns) * column_width table.attach(new_lbl, 0 + j, 1 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2) table.attach(new_inp, 2 + j, 3 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2) if prop.inheritable is not None: inh_prop = all_props.get(prop.inherit_flag, None) if inh_prop is None: raise ValueError( "The inherit flag property `%s` is missing for `%s` on meta model with store id `%s`" % (prop.inherit_flag, prop.label, meta.store_id)) new_check = Gtk.CheckButton(label="") new_check.set_tooltip_text(inh_prop.title) new_check.set_name(self.widget_format % inh_prop.label) new_check.set_sensitive(False) self[self.widget_format % inh_prop.label] = new_check check_widgets[i] = new_check table.attach(new_check, 1 + j, 2 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2, xoptions=Gtk.AttachOptions.FILL) del new_inp, new_lbl return input_widgets, check_widgets
def add_scale_widget(self, prop, enforce_range=True): # Create the widget: inp = ScaleEntry(prop.minimum, prop.maximum, enforce_range=enforce_range) inp.set_tooltip_text(prop.title) self[self.widget_format % prop.label] = inp # Add & return the widget return self._add_widget_to_container(inp, self._get_widget_container(prop))
def create_inputs(table): input_widgets = [None] * N check_widgets = [None] * N num_columns = 2 column_width = 3 for i, prop in enumerate(self.props): new_lbl = self.create_mathtext_widget(prop.math_label, prop.label) new_inp = ScaleEntry(lower=prop.minimum, upper=prop.maximum, enforce_range=True) new_inp.set_tooltip_text(prop.label) new_inp.set_name(self.widget_format % prop.name) self[self.widget_format % prop.name] = new_inp input_widgets[i] = new_inp j = (i % num_columns) * column_width table.attach(new_lbl, 0 + j, 1 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2) table.attach(new_inp, 2 + j, 3 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2) if prop.inh_name is not None: inh_prop = meta.get_prop_intel_by_name(prop.inh_name) new_check = gtk.CheckButton(label="") new_check.set_tooltip_text(inh_prop.label) new_check.set_name(self.widget_format % inh_prop.name) new_check.set_sensitive(False) self[self.widget_format % inh_prop.name] = new_check check_widgets[i] = new_check table.attach(new_check, 1 + j, 2 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2, xoptions=gtk.FILL) del new_inp, new_lbl return input_widgets, check_widgets
def create_inputs(table): input_widgets = [None] * N check_widgets = [None] * N num_columns = 2 column_width = 3 for i, prop in enumerate(self.props): new_lbl = self.create_mathtext_widget(prop.math_title, prop.label) new_inp = ScaleEntry(lower=prop.minimum, upper=prop.maximum, enforce_range=True) new_inp.set_tooltip_text(prop.title) new_inp.set_name(self.widget_format % prop.label) self[self.widget_format % prop.label] = new_inp input_widgets[i] = new_inp j = (i % num_columns) * column_width table.attach(new_lbl, 0 + j, 1 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2) table.attach(new_inp, 2 + j, 3 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2) if prop.inheritable is not None: inh_prop = all_props.get(prop.inherit_flag, None) if inh_prop is None: raise ValueError("The inherit flag property `%s` is missing for `%s` on meta model with store id `%s`" % ( prop.inherit_flag, prop.label, meta.store_id )) new_check = Gtk.CheckButton(label="") new_check.set_tooltip_text(inh_prop.title) new_check.set_name(self.widget_format % inh_prop.label) new_check.set_sensitive(False) self[self.widget_format % inh_prop.label] = new_check check_widgets[i] = new_check table.attach(new_check, 1 + j, 2 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2, xoptions=Gtk.AttachOptions.FILL) del new_inp, new_lbl return input_widgets, check_widgets
def create_inputs(table): input_widgets = [None] * N check_widgets = [None] * N num_columns = 2 column_width = 3 for i, prop in enumerate(self.props): new_lbl = self.create_mathtext_widget(prop.math_label, prop.label) new_inp = ScaleEntry(lower=prop.minimum, upper=prop.maximum, enforce_range=True) new_inp.set_tooltip_text(prop.label) new_inp.set_name(self.widget_format % prop.name) self[self.widget_format % prop.name] = new_inp input_widgets[i] = new_inp j = (i % num_columns) * column_width table.attach(new_lbl, 0 + j, 1 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2) table.attach(new_inp, 2 + j, 3 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2) if prop.inh_name is not None: inh_prop = meta.get_prop_intel_by_name(prop.inh_name) new_check = gtk.CheckButton(label="") new_check.set_tooltip_text(inh_prop.label) new_check.set_name(self.widget_format % inh_prop.name) new_check.set_sensitive(False) self[self.widget_format % inh_prop.name] = new_check check_widgets[i] = new_check table.attach(new_check, 1 + j, 2 + j, i / num_columns, (i / num_columns) + 1, xpadding=2, ypadding=2, xoptions=gtk.FILL) del new_inp, new_lbl return input_widgets, check_widgets