Example #1
0
static void
gimp_dialog_response (GtkDialog *dialog,
                      gint       response_id)
{
  GList *children;
  GList *list;

  children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));

  for (list = children; list; list = g_list_next (list))
    {
      GtkWidget *widget = list->data;

      if (gtk_dialog_get_response_for_widget (dialog, widget) == response_id)
        {
          if (! GTK_IS_BUTTON (widget) ||
              gtk_button_get_focus_on_click (GTK_BUTTON (widget)))
            {
              gtk_widget_grab_focus (widget);
            }

          break;
        }
    }

  g_list_free (children);
}
Example #2
0
/*
 * Gets the properties of the widget. This is used for both displaying the
 * properties in the property editor, and also for saving the properties.
 */
static void
gb_gnome_color_picker_get_properties (GtkWidget *widget, GbWidgetGetArgData * data)
{
  gb_widget_output_bool (data, Dither, gnome_color_picker_get_dither (GNOME_COLOR_PICKER (widget)));
  gb_widget_output_bool (data, UseAlpha,
			 gnome_color_picker_get_use_alpha (GNOME_COLOR_PICKER (widget)));
  gb_widget_output_translatable_string (data, Title,
					gnome_color_picker_get_title (GNOME_COLOR_PICKER (widget)));

  gb_widget_output_bool (data, FocusOnClick,
			 gtk_button_get_focus_on_click (GTK_BUTTON (widget)));
}
Example #3
0
int
clip_GTK_BUTTONGETFOCUSONCLICK(ClipMachine * ClipMachineMemory)
{
   C_widget *cbtn = _fetch_cw_arg(ClipMachineMemory);

   CHECKCWID(cbtn, GTK_IS_BUTTON);

   _clip_retl(ClipMachineMemory, gtk_button_get_focus_on_click(GTK_BUTTON(cbtn->widget)));

   return 0;
 err:
   return 1;
}
Example #4
0
/*
 * Writes the source code needed to create this widget.
 * You have to output everything necessary to create the widget here, though
 * there are some convenience functions to help.
 */
static void
gb_gnome_color_picker_write_source (GtkWidget * widget, GbWidgetWriteSourceData * data)
{
  if (data->create_widget)
    {
      source_add (data, "  %s = gnome_color_picker_new ();\n", data->wname);
    }

  gb_widget_write_standard_source (widget, data);

  if (strcmp (gnome_color_picker_get_title (GNOME_COLOR_PICKER (widget)),
	      dgettext (GLADE_LIBGNOMEUI_GETTEXT_PACKAGE, "Pick a color")))
    {
      gboolean translatable, context;
      gchar *comments;

      glade_util_get_translation_properties (widget, Title, &translatable,
					     &comments, &context);
      source_add_translator_comments (data, translatable, comments);

      source_add (data,
		  "  gnome_color_picker_set_title (GNOME_COLOR_PICKER (%s), %s);\n",
		  data->wname,
		  source_make_string_full (gnome_color_picker_get_title (GNOME_COLOR_PICKER (widget)),
					   data->use_gettext && translatable,
					   context));
    }

  if (!gnome_color_picker_get_dither (GNOME_COLOR_PICKER (widget)))
    {
      source_add (data,
		  "  gnome_color_picker_set_dither (GNOME_COLOR_PICKER (%s), FALSE);\n",
		  data->wname);

    }

  if (gnome_color_picker_get_use_alpha (GNOME_COLOR_PICKER (widget)))
    {
      source_add (data,
		  "  gnome_color_picker_set_use_alpha (GNOME_COLOR_PICKER (%s), TRUE);\n",
		  data->wname);
    }

  if (!gtk_button_get_focus_on_click (GTK_BUTTON (widget)))
    {
      source_add (data,
		  "  gtk_button_set_focus_on_click (GTK_BUTTON (%s), FALSE);\n",
		  data->wname);
    }
}
Example #5
0
/*
 * Gets the properties of the widget. This is used for both displaying the
 * properties in the property editor, and also for saving the properties.
 */
static void
gb_gnome_href_get_properties (GtkWidget *widget, GbWidgetGetArgData * data)
{
  gchar *uri, *label;

  g_object_get (G_OBJECT (widget),
		"url", &uri,
		"text", &label,
		NULL);
  gb_widget_output_string (data, HRefURL, uri);
  gb_widget_output_translatable_text (data, HRefLabel, label);

  g_free (uri);
  g_free (label);

  gb_widget_output_bool (data, FocusOnClick,
			 gtk_button_get_focus_on_click (GTK_BUTTON (widget)));
}
Example #6
0
/*
 * Writes the source code needed to create this widget.
 * You have to output everything necessary to create the widget here, though
 * there are some convenience functions to help.
 */
static void
gb_gnome_href_write_source (GtkWidget * widget, GbWidgetWriteSourceData * data)
{
  gboolean translatable, context;
  gchar *comments;

  if (data->create_widget)
    {
      gchar *url, *label_text;

      g_object_get (G_OBJECT (widget),
		    "url", &url,
		    "text", &label_text,
		    NULL);
 
      glade_util_get_translation_properties (widget, HRefURL, &translatable,
					     &comments, &context);
      source_add_translator_comments (data, translatable, comments);

      source_add (data, "  %s = gnome_href_new (%s, ",
		  data->wname,
		  url && *url ? source_make_string (url, FALSE) : "\"\"");

      source_add (data, "%s);\n",
		  source_make_string_full (label_text, data->use_gettext && translatable, context));
    }

  gb_widget_write_standard_source (widget, data);

  if (!gtk_button_get_focus_on_click (GTK_BUTTON (widget)))
    {
      source_add (data,
		  "  gtk_button_set_focus_on_click (GTK_BUTTON (%s), FALSE);\n",
		  data->wname);
    }
}