Respond to user click on a palette item.
352644
def _reset_preview(self, event):
        """"""
        label = event.widget
        label.master.focus_set()
        label.master.configure(relief="sunken")
        args = self._old_color
        if self.alpha_channel:
            args += (self._old_alpha,)
            self.alpha.set(self._old_alpha)
            self.alphabar.set_color(args)
        color = rgb_to_hexa(*args)
        h, s, v = rgb_to_hsv(*self._old_color)
        self.red.set(self._old_color[0])
        self.green.set(self._old_color[1])
        self.blue.set(self._old_color[2])
        self.hue.set(h)
        self.saturation.set(s)
        self.value.set(v)
        self.hexa.delete(0, "end")
        self.hexa.insert(0, color.upper())
        self.bar.set(h)
        self.square.set_hsv((h, s, v))
        self._update_preview()
1357532
def click(self, x, y):
        '''
        
        '''
        self.shell('input', 'tap', str(x), str(y))
201528
public void onClick(MenuItemClickEvent event) {
		final FeatureTransaction ft = mapWidget.getMapModel().getFeatureEditor().getFeatureTransaction();
		if (ft != null) {
			SimpleFeatureAttributeWindow window = new SimpleFeatureAttributeWindow(ft.getNewFeatures()[0]) {

				public void onOk(Feature feature) {
					// Copy the attributes to the real feature:
					// Don't overwrite the feature itself, as the GraphicsContext expects the same object for rendering!
					ft.getNewFeatures()[0].setAttributes(feature.getAttributes());
				}

				public void onClose() {
				}
			};
			window.show();
		}
	}
689755
def respond(self, request, view, newsitems, extra_context={}):
        """"""
        context = self.get_context(request, view=view)
        context.update(self.paginate_newsitems(request, newsitems))
        context.update(extra_context)
        template = self.get_template(request, view=view)
        return TemplateResponse(request, template, context)
257978
def _showItemContextMenu(self, item, point, col):
        """"""
        self._startOrStopEditing()
        menu = getattr(item, '_menu', None)
        if menu:
            # self._current_item tells callbacks what item the menu was referring to
            self._current_item = item
            self.clearSelection()
            self.setItemSelected(item, True)
            menu.exec_(point)
        else:
            self._current_item = None
825427
def press(self):
    """"""
    self._lutron.send(Lutron.OP_EXECUTE, Keypad._CMD_TYPE, self._keypad.id,
                      self.component_number, Button._ACTION_PRESS)
645052
def contextMenuEvent(self, event):
        """"""
        self.opt_menu.popup(event.globalPos())
        event.accept()
179905
function (item) {
				var html    = "",
				    type    = item.type,
				    message = item.message,
				    css     = item.cssClass || "";

				html += "<div class=\"alertify-dialog\">";

				if (_alertify.buttonFocus === "none") html += "<a href=\"#\" id=\"alertify-noneFocus\" class=\"alertify-hidden\"></a>";

				if (type === "prompt") html += "<form id=\"alertify-form\">";

				html += "<article class=\"alertify-inner\">";
				html += dialogs.message.replace("{{message}}", message);

				if (type === "prompt") html += dialogs.input;

				html += dialogs.buttons.holder;
				html += "</article>";

				if (type === "prompt") html += "</form>";

				html += "<a id=\"alertify-resetFocus\" class=\"alertify-resetFocus\" href=\"#\">Reset Focus</a>";
				html += "</div>";

				switch (type) {
				case "confirm":
					html = html.replace("{{buttons}}", this.appendButtons(dialogs.buttons.cancel, dialogs.buttons.ok));
					html = html.replace("{{ok}}", this.labels.ok).replace("{{cancel}}", this.labels.cancel);
					break;
				case "prompt":
					html = html.replace("{{buttons}}", this.appendButtons(dialogs.buttons.cancel, dialogs.buttons.submit));
					html = html.replace("{{ok}}", this.labels.ok).replace("{{cancel}}", this.labels.cancel);
					break;
				case "alert":
					html = html.replace("{{buttons}}", dialogs.buttons.ok);
					html = html.replace("{{ok}}", this.labels.ok);
					break;
				default:
					break;
				}

				elDialog.className = "alertify alertify-" + type + " " + css;
				elCover.className  = "alertify-cover";
				return html;
			}
1042532
def handle_response(self, item_session: ItemSession) -> Actions:
        '''
        '''
        action = self.consult_response_hook(item_session)

        if action == Actions.RETRY:
            item_session.set_status(Status.error)
        elif action == Actions.FINISH:
            item_session.set_status(Status.done)
        elif action == Actions.STOP:
            raise HookStop('Script requested immediate stop.')

        return action
953400
public void acceptPrompt() {
        String action = "Clicking 'OK' on a prompt";
        String expected = "Prompt is present to be clicked";
        if (isNotPrompt(action, expected, "click")) {
            return;
        }
        accept(action, expected, "prompt");
    }
64052
def focusInEvent(self, event):
        """"""
        show_status = getattr(self.lineEdit(), 'show_status_icon', None)
        if show_status:
            show_status()
        QComboBox.focusInEvent(self, event)
858922
public void onItemClick() {
        if (selected) {
            selected = false;
            getView().reset();

            if (onResetCommand != null) {
                onResetCommand.execute();
            }
        }
        else {
            selected = true;
            getView().select();

            if (onSelectCommand != null) {
                onSelectCommand.execute();
            }
        }
    }
1114480
def respond_to?(method_sym, include_private = false)
      method_name = method_sym.to_s
      case 
        when KNOWN_ELEMENTS.include?(method_name.gsub(/^uniq_/,''))
          # page_object.uniq_xxx(hash)
          true
        when has_eset?(method_name)
          # page_object.some_elements_set
          true
        when has_element?(method_name)
          # page_object.some_element
          true
        when FEED_ALL.match(method_name)
          # page_object.feed_all(:fresh_food)
          true
        when (FEED.match(method_name) and has_eset?($1))
          # page_object.feed_some_elements_set(:fresh_food)
          true
        when (FEED.match(method_name) and has_element?($1))
          # page_object.feed_some_element(:fresh_food)
          true
        when (FIRE_ACTION.match(method_name) and has_action?($1))
          # page_object.fire_some_action
          true
        when (FIRE_ACTION.match(method_name) and has_alias?($1))
          # page_object.fire_some_action
          true
        when (VALIDATE.match(method_name) and has_action?($1))
          # page_object.validate_xxx
          true
        when (SELECT_FROM.match(method_name) and has_table?($1))
          # page_object.select_from_some_table(:header_column, {:column => 'value'})
          true
        when (SELECT_ROW_FROM.match(method_name) and has_table?($1))
          # page_object.select_from_some_table(:header_column, {:column => 'value'})
          true
        when (PAGINATION_EACH.match(method_name) and has_pagination?($1))
          # page_object.each_pagination
          true
        when (PAGINATION_OPEN.match(method_name) and has_pagination?($1))
          # page_object.open_padination(1)
          true
        when (PRESS.match(method_name) and has_element?($1))
          # page_object.press_element
          true
        else
          super
      end
    end
611903
def render(self, surf):
        """"""

        if self.clicked:
            icon = self.icon_pressed
        else:
            icon = self.icon

        surf.blit(icon, self)
1251973
def prompt_user(prompt):
    """"""
    # raw_input returns the empty string for "enter"
    yes = set(['yes', 'y'])
    no = set(['no','n'])

    try:
        print(prompt)
        choice = input().lower()
        # would like to test for exception here, but not sure if we can do that without importing IPython
    except:
        print('Stdin is not implemented.')
        print('You need to set')
        print('overide_manual_authorize=True')
        print('to proceed with the download. Please set that variable and continue.')
        raise


    if choice in yes:
        return True
    elif choice in no:
        return False
    else:
        print(("Your response was a " + choice))
        print("Please respond with 'yes', 'y' or 'no', 'n'")
1335652
public void onClick(MenuItemClickEvent event) {
		final FeatureTransaction ft = mapWidget.getMapModel().getFeatureEditor().getFeatureTransaction();
		if (ft != null && index != null) {
			List<Feature> features = new ArrayList<Feature>();
			features.add(ft.getNewFeatures()[index.getFeatureIndex()]);
			LazyLoader.lazyLoad(features, GeomajasConstant.FEATURE_INCLUDE_GEOMETRY, new LazyLoadCallback() {

				public void execute(List<Feature> response) {
					controller.setEditMode(EditMode.INSERT_MODE);
					Geometry geometry = response.get(0).getGeometry();
					if (geometry instanceof Polygon) {
						geometry = addRing((Polygon) geometry);
					} else if (geometry instanceof MultiPolygon) {
						geometry = addRing((MultiPolygon) geometry);
					}
					ft.getNewFeatures()[index.getFeatureIndex()].setGeometry(geometry);
					controller.setGeometryIndex(index);
					controller.hideGeometricInfo();
				}
			});
		}
	}
1244488
function openReply(id) {
    // Swap out the reply link for the hide link
    $('#rl' + id).hide();
    $('#cr' + id).show();

    // Add the reply li to the children ul.
    var div = $(renderTemplate(replyTemplate, {id: id})).hide();
    $('#cl' + id)
      .prepend(div)
      // Setup the submit handler for the reply form.
      .find('#rf' + id)
      .submit(function(event) {
        event.preventDefault();
        addComment($('#rf' + id));
        closeReply(id);
      })
      .find('input[type=button]')
      .click(function() {
        closeReply(id);
      });
    div.slideDown('fast', function() {
      $('#rf' + id).find('textarea').focus();
    });
  }