コード例 #1
0
ファイル: gtkradiotoolbutton.c プロジェクト: GYGit/gtk
static void
gtk_radio_tool_button_set_property (GObject         *object,
				    guint            prop_id,
				    const GValue    *value,
				    GParamSpec      *pspec)
{
  GtkRadioToolButton *button;

  button = GTK_RADIO_TOOL_BUTTON (object);

  switch (prop_id)
    {
    case PROP_GROUP:
      {
	GtkRadioToolButton *arg;
	GSList *slist = NULL;
	if (G_VALUE_HOLDS_OBJECT (value)) 
	  {
	    arg = GTK_RADIO_TOOL_BUTTON (g_value_get_object (value));
	    if (arg)
	      slist = gtk_radio_tool_button_get_group (arg);
	    gtk_radio_tool_button_set_group (button, slist);
	  }
      }
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
    }
}
コード例 #2
0
ファイル: gtkradiotoolbutton.c プロジェクト: GYGit/gtk
/**
 * gtk_radio_tool_button_new:
 * @group: (allow-none) (element-type GtkRadioButton): An
 *   existing radio button group, or %NULL if you are creating a new group
 * 
 * Creates a new #GtkRadioToolButton, adding it to @group.
 * 
 * Returns: The new #GtkRadioToolButton
 * 
 * Since: 2.4
 **/
GtkToolItem *
gtk_radio_tool_button_new (GSList *group)
{
  GtkRadioToolButton *button;
  
  button = g_object_new (GTK_TYPE_RADIO_TOOL_BUTTON,
			 NULL);

  gtk_radio_tool_button_set_group (button, group);
  
  return GTK_TOOL_ITEM (button);
}
コード例 #3
0
static VALUE
rbtn_set_group(VALUE self, VALUE rbgroup)
{
    GtkRadioToolButton *button = _SELF(self);
    GSList *group = TYPE(rbgroup) == T_ARRAY ?
        /* TODO: This might leak. */
        RVAL2GTKRADIOTOOLBUTTONGSLIST(rbgroup) :
        gtk_radio_tool_button_get_group(_SELF(rbgroup));

    gtk_radio_tool_button_set_group(button, group);

    return self;
}
コード例 #4
0
ファイル: gtkradiotoolbutton.c プロジェクト: GYGit/gtk
/**
 * gtk_radio_tool_button_new_from_stock:
 * @group: (allow-none) (element-type GtkRadioButton): an existing radio button
 *   group, or %NULL if you are creating a new group
 * @stock_id: the name of a stock item
 * 
 * Creates a new #GtkRadioToolButton, adding it to @group. 
 * The new #GtkRadioToolButton will contain an icon and label from the
 * stock item indicated by @stock_id.
 * 
 * Returns: The new #GtkRadioToolButton
 * 
 * Since: 2.4
 *
 * Deprecated: 3.10: Use gtk_radio_tool_button_new() instead.
 **/
GtkToolItem *
gtk_radio_tool_button_new_from_stock (GSList      *group,
				      const gchar *stock_id)
{
  GtkRadioToolButton *button;

  g_return_val_if_fail (stock_id != NULL, NULL);
  
  button = g_object_new (GTK_TYPE_RADIO_TOOL_BUTTON,
			 "stock-id", stock_id,
			 NULL);


  gtk_radio_tool_button_set_group (button, group);
  
  return GTK_TOOL_ITEM (button);
}
コード例 #5
0
ファイル: ev878.c プロジェクト: yehongbing/Eiffel-Projects
/* {EV_TOOL_BAR_RADIO_BUTTON_IMP}.set_item_parent_imp */
void F1182_16627 (EIF_REFERENCE Current, EIF_REFERENCE arg1)
{
    GTCX
    EIF_POINTER tp1;
    EIF_POINTER tp2;
    RTLD;

    RTLI(2);
    RTLR(0,arg1);
    RTLR(1,Current);

    RTGC;
    F1165_16461(Current, arg1);
    if ((EIF_BOOLEAN)(arg1 == NULL)) {
        tp1 = F1079_14146(Current);
        tp2 = (EIF_POINTER) NULL;
        gtk_radio_tool_button_set_group((GtkRadioToolButton*) tp1, (GSList*) tp2);
    }
    RTLE;
}
コード例 #6
0
/*
 * Sets the properties of the widget. This is used for both applying the
 * properties changed in the property editor, and also for loading.
 */
static void
gb_radio_tool_button_set_properties (GtkWidget * widget, GbWidgetSetArgData * data)
{
  gboolean active;
  gchar *group_name;

  gb_tool_button_set_standard_properties (widget, data,
					  StockButton, Label, Icon,
					  VisibleHorz, VisibleVert,
					  IsImportant);

  active = gb_widget_input_bool (data, Active);
  if (data->apply)
    {
      gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (widget),
					 active);
      if (active)
	data->widget_data->flags |= GLADE_ACTIVE;
      else
	data->widget_data->flags &= ~GLADE_ACTIVE;
    }

  /* Find any widgets in given group and set this widgets group.
     If group is NULL try to find radiobuttons with same parent and use
     their group. If these don't succeed, set group to NULL. */
  group_name = gb_widget_input_combo (data, Group);
  if (data->apply)
    {
      GSList *old_group, *new_group = NULL;

      old_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (widget));

      if (group_name && (group_name[0] == '\0'
			 || !strcmp (group_name, _("New Group"))))
	group_name = NULL;

      if (group_name)
	{
	  GladeFindGroupWidgetData find_data;

	  find_data.name = group_name;
	  find_data.found_widget = NULL;
	  gb_widget_children_foreach (widget->parent,
				      (GtkCallback) find_group_widget,
				      &find_data);

	  if (find_data.found_widget)
	    new_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (find_data.found_widget));
	  else if (data->action == GB_LOADING)
	    g_warning ("Invalid radio group: %s\n   (Note that forward references are not allowed in Glade files)", group_name);
	}

#if 0
      g_print ("New Group: %p Old Group: %p\n", new_group, old_group);
#endif

      if (new_group != old_group)
	{
#if 0
	  g_print ("##### setting radio group: %s\n",
		   group_name ? group_name : "NULL");
#endif
	  gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (widget),
					   new_group);
	}
    }
}