• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GTK_COLOR_SELECTION函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GTK_COLOR_SELECTION函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_COLOR_SELECTION函数的具体用法?C++ GTK_COLOR_SELECTION怎么用?C++ GTK_COLOR_SELECTION使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GTK_COLOR_SELECTION函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: upj2

void upj2(GtkWidget *wgt, gpointer dta)
{
	GdkColor cl1;
	guint16 alp;
	GtkPlot *pt;

	pt=GTK_PLOT(pt2);
	if (gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(wgt)))
	{
		(cl1.red)=(guint16) (65535*g_array_index((pt->rd), gdouble, 1));
		(cl1.green)=(guint16) (65535*g_array_index((pt->gr), gdouble, 1));
		(cl1.blue)=(guint16) (65535*g_array_index((pt->bl), gdouble, 1));
		alp=(guint16) (65535*g_array_index((pt->al), gdouble, 1));
	}
	else
	{
		(cl1.red)=(guint16) (65535*g_array_index((pt->rd), gdouble, 0));
		(cl1.green)=(guint16) (65535*g_array_index((pt->gr), gdouble, 0));
		(cl1.blue)=(guint16) (65535*g_array_index((pt->bl), gdouble, 0));
		alp=(guint16) (65535*g_array_index((pt->al), gdouble, 0));
	}
	gdk_colormap_alloc_color(cmp, &cl1, FALSE, TRUE);
	gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(cs2), &cl1);
	gtk_color_selection_set_current_alpha(GTK_COLOR_SELECTION(cs2), alp);
}
开发者ID:pchilds,项目名称:IS_TIB,代码行数:25,代码来源:disp.c


示例2: row_activated

 static void row_activated(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, GtkWidget *widget)
 {
	GtkTreeIter		iter;
	GtkTreeModel	*model	= gtk_tree_view_get_model(view);
	GValue			value	= { 0, };
	int				id;

	if(!gtk_tree_model_get_iter(model,&iter,path))
	{
		gtk_widget_set_sensitive(widget,0);
		return;
	}

	gtk_tree_model_get_value(model,&iter,1,&value);

	id = g_value_get_int(&value);
	g_object_set_data(G_OBJECT(widget),"selected",(gpointer) id);

	if(id < 0 || id >= TERMINAL_COLOR_COUNT)
	{
		gtk_widget_set_sensitive(widget,0);
		return;
	}

	gtk_color_selection_set_previous_color(GTK_COLOR_SELECTION(widget),color+id);
	gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(widget),color+id);

	gtk_widget_set_sensitive(widget,1);

 }
开发者ID:laubstein,项目名称:pw3270,代码行数:30,代码来源:colors.c


示例3: clip_GTK_COLORSELECTIONSETCOLOR

/* Sets the color in the GtkColorSelection. The widgets are updated to
 * reflect the new color. */
int
clip_GTK_COLORSELECTIONSETCOLOR(ClipMachine * ClipMachineMemory)
{
   C_widget *ccsel = _fetch_cw_arg(ClipMachineMemory);

   ClipVar  *mcolor = _clip_spar(ClipMachineMemory, 2);

   gdouble   color[4];

   gdouble   k, max;

   CHECKCWID(ccsel, GTK_IS_COLOR_SELECTION);
   CHECKOPT(2, MAP_type_of_ClipVarType);
   if (_clip_parinfo(ClipMachineMemory, 2) == UNDEF_type_of_ClipVarType)
      gtk_color_selection_get_color(GTK_COLOR_SELECTION(ccsel->widget), color);
   else
      _map_get_colors(ClipMachineMemory, mcolor, color);
   color[0] = color[0] > 0 ? color[0] : 1;
   color[1] = color[1] > 0 ? color[1] : 1;
   color[2] = color[2] > 0 ? color[2] : 1;
   max = color[0] > color[1] ? color[0] : color[1];
   max = max > color[2] ? max : color[2];
   max = max > 0 ? max : 1;
   k = 1 / max;
   color[0] *= k;
   color[1] *= k;
   color[2] *= k;
   gtk_color_selection_set_color(GTK_COLOR_SELECTION(ccsel->widget), color);
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:34,代码来源:colorsel.c


示例4: uber_label_block_button_press_event

/**
 * uber_label_block_button_press_event:
 * @widget: A #GtkWidget.
 * @event: A #GdkEventButton.
 * @label: An #UberLabel.
 *
 * Callback to handle a button press event within the colored block.
 *
 * Returns: %FALSE always to allow further signal emission.
 * Side effects: None.
 */
static gboolean
uber_label_block_button_press_event (GtkWidget      *widget, /* IN */
                                     GdkEventButton *event,  /* IN */
                                     UberLabel      *label)  /* IN */
{
	UberLabelPrivate *priv;
	GtkWidget *dialog;
	GtkWidget *selection;

	g_return_val_if_fail(UBER_IS_LABEL(label), FALSE);

	priv = label->priv;
	dialog = gtk_color_selection_dialog_new("");
	selection = gtk_color_selection_dialog_get_color_selection(
			GTK_COLOR_SELECTION_DIALOG(dialog));
	gtk_color_selection_set_current_color(
			GTK_COLOR_SELECTION(selection),
			&priv->color);
	if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) {
		gtk_color_selection_get_current_color(
				GTK_COLOR_SELECTION(selection),
				&priv->color);
		gtk_widget_queue_draw(widget);
		g_signal_emit(label, signals[COLOR_CHANGED],
		              0, &priv->color);
	}
	gtk_widget_destroy(dialog);
	return FALSE;
}
开发者ID:jjardon,项目名称:perfkit,代码行数:40,代码来源:uber-label.c


示例5: gtk_color_selection_set_current_color

bool GtkToolkitColorChooser::Show(X11Types::Window parent, uint32_t initial_color)
{
	GdkColor old_color = GtkUtils::ColorrefToGdkColor(initial_color);
	gtk_color_selection_set_current_color (
			GTK_COLOR_SELECTION(m_color_selector), &old_color);

	// we have to show dialog before running it
	gtk_widget_show(m_dialog);
	// otherwise this will result in nasty crash inside gtk
	XSetTransientForHint(GDK_WINDOW_XDISPLAY(gtk_widget_get_window(m_dialog)),
						 GDK_WINDOW_XID(gtk_widget_get_window(m_dialog)), parent);
	GtkUtils::SetResourceName(m_dialog, "colorselectordialog");

	gint result = gtk_dialog_run(GTK_DIALOG(m_dialog));

	GdkColor new_color;
	gtk_color_selection_get_current_color(
			GTK_COLOR_SELECTION(m_color_selector), &new_color);

	m_color = GtkUtils::GdkColorToColorref(&new_color);

	gtk_widget_destroy (m_dialog);
	GtkUtils::ProcessEvents();

	return (GTK_RESPONSE_OK == result);
}
开发者ID:prestocore,项目名称:browser,代码行数:26,代码来源:GtkColorChooser.cpp


示例6: purplerc_set_color

static void
purplerc_set_color(GtkWidget *widget, gpointer data)
{
	GdkColor color;
	gchar title[128];
	const gchar *pref = NULL;
	GtkWidget *color_dialog = NULL;
	gint subscript = GPOINTER_TO_INT(data);

	g_snprintf(title, sizeof(title), _("Select Color for %s"),
	           _(color_names[GPOINTER_TO_INT(data)]));
	color_dialog = gtk_color_selection_dialog_new(_("Select Color"));
	g_signal_connect(G_OBJECT(color_dialog), "response",
	                 G_CALLBACK(purplerc_color_response), data);

	pref = purple_prefs_get_string(color_prefs[subscript]);

	if (pref != NULL && strcmp(pref, "")) {
		if (gdk_color_parse(pref, &color)) {
#if GTK_CHECK_VERSION(2,14,0)
			gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(
				gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog))),
				&color);
#else
			gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel), &color);
#endif
		}
	}

	gtk_window_present(GTK_WINDOW(color_dialog));
}
开发者ID:Draghtnod,项目名称:pidgin,代码行数:31,代码来源:pidginrc.c


示例7: DIA_colorSel

int DIA_colorSel(uint8_t *r, uint8_t *g, uint8_t *b)
{
GtkWidget *dialog;
int ret=0;

GdkColor color;

	dialog=create_colorselectiondialog1();

	color.red=*r<<8;
	color.green=*g<<8;
	color.blue=*b<<8;

	gtk_color_selection_set_current_color    (GTK_COLOR_SELECTION(WID(color_selection1)),&color);


	if(GTK_RESPONSE_OK==gtk_dialog_run(GTK_DIALOG(dialog)))
	{

  		gtk_color_selection_get_current_color    (GTK_COLOR_SELECTION(WID(color_selection1)),&color);
		*r=color.red>>8;
		*g=color.green>>8;
		*b=color.blue>>8;
		ret=1;
	}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:25,代码来源:DIA_color.cpp


示例8: clip_GTK_COLORSELECTIONGETCOLOR

/* Retrieve the currently selected color value. */
int
clip_GTK_COLORSELECTIONGETCOLOR(ClipMachine * ClipMachineMemory)
{
   C_widget *ccsel = _fetch_cw_arg(ClipMachineMemory);

   GtkColorSelection *colorsel;

   ClipVar   mcolor;

   gdouble   color[4];

   CHECKCWID(ccsel, GTK_IS_COLOR_SELECTION);
   colorsel = GTK_COLOR_SELECTION(ccsel->widget);
   gtk_color_selection_get_color(GTK_COLOR_SELECTION(ccsel->widget), color);
   color[0] *= CLIP_GTK_MAX_COLOR;
   color[1] *= CLIP_GTK_MAX_COLOR;
   color[2] *= CLIP_GTK_MAX_COLOR;
   memset(&mcolor, 0, sizeof(mcolor));
   _clip_map(ClipMachineMemory, &mcolor);
   _map_put_colors(ClipMachineMemory, &mcolor, color);
   _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &mcolor);
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:26,代码来源:colorsel.c


示例9: gtk_color_button_clicked

static void
gtk_color_button_clicked (GtkButton *button)
{
  GtkColorButton *color_button = GTK_COLOR_BUTTON (button);
  GtkColorSelectionDialog *color_dialog;

  /* if dialog already exists, make sure it's shown and raised */
  if (!color_button->priv->cs_dialog) 
    {
      /* Create the dialog and connects its buttons */
      GtkWidget *parent;
      
      parent = gtk_widget_get_toplevel (GTK_WIDGET (color_button));
      
      color_button->priv->cs_dialog = gtk_color_selection_dialog_new (color_button->priv->title);
      
      color_dialog = GTK_COLOR_SELECTION_DIALOG (color_button->priv->cs_dialog);

      if (gtk_widget_is_toplevel (parent) && GTK_IS_WINDOW (parent))
        {
          if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (color_dialog)))
 	    gtk_window_set_transient_for (GTK_WINDOW (color_dialog), GTK_WINDOW (parent));
	       
	  gtk_window_set_modal (GTK_WINDOW (color_dialog),
				gtk_window_get_modal (GTK_WINDOW (parent)));
	}
      
      g_signal_connect (color_dialog->ok_button, "clicked",
                        G_CALLBACK (dialog_ok_clicked), color_button);
      g_signal_connect (color_dialog->cancel_button, "clicked",
			G_CALLBACK (dialog_cancel_clicked), color_button);
      g_signal_connect (color_dialog, "destroy",
                        G_CALLBACK (dialog_destroy), color_button);
    }

  color_dialog = GTK_COLOR_SELECTION_DIALOG (color_button->priv->cs_dialog);

  gtk_color_selection_set_has_opacity_control (GTK_COLOR_SELECTION (color_dialog->colorsel),
                                               color_button->priv->use_alpha);
  
  gtk_color_selection_set_previous_color (GTK_COLOR_SELECTION (color_dialog->colorsel), 
					  &color_button->priv->color);
  gtk_color_selection_set_previous_alpha (GTK_COLOR_SELECTION (color_dialog->colorsel), 
					  color_button->priv->alpha);

  gtk_color_selection_set_current_color (GTK_COLOR_SELECTION (color_dialog->colorsel), 
					 &color_button->priv->color);
  gtk_color_selection_set_current_alpha (GTK_COLOR_SELECTION (color_dialog->colorsel), 
					 color_button->priv->alpha);

  gtk_window_present (GTK_WINDOW (color_button->priv->cs_dialog));
}
开发者ID:Krlos0208,项目名称:Sintetizador_Voz,代码行数:52,代码来源:gtkcolorbutton.c


示例10: gsm_color_button_clicked

static gint
gsm_color_button_clicked (GtkWidget * widget, GdkEventButton * event)
{
  GSMColorButton *color_button = GSM_COLOR_BUTTON (widget);
  GtkColorSelectionDialog *color_dialog;

  /* if dialog already exists, make sure it's shown and raised */
  if (!color_button->priv->cs_dialog)
    {
      /* Create the dialog and connects its buttons */
      GtkWidget *parent;

      parent = gtk_widget_get_toplevel (GTK_WIDGET (color_button));

      color_button->priv->cs_dialog =
	gtk_color_selection_dialog_new (color_button->priv->title);

      color_dialog =
	GTK_COLOR_SELECTION_DIALOG (color_button->priv->cs_dialog);

      if (gtk_widget_is_toplevel (parent) && GTK_IS_WINDOW (parent))
	{
	  if (GTK_WINDOW (parent) !=
	      gtk_window_get_transient_for (GTK_WINDOW (color_dialog)))
	    gtk_window_set_transient_for (GTK_WINDOW (color_dialog),
					  GTK_WINDOW (parent));

	  gtk_window_set_modal (GTK_WINDOW (color_dialog),
				gtk_window_get_modal (GTK_WINDOW (parent)));
	}

      g_signal_connect (color_dialog, "response",
                        G_CALLBACK (dialog_response), color_button);

      g_signal_connect (color_dialog, "destroy",
			G_CALLBACK (dialog_destroy), color_button);
    }

  color_dialog = GTK_COLOR_SELECTION_DIALOG (color_button->priv->cs_dialog);

  gtk_color_selection_set_previous_color (GTK_COLOR_SELECTION
                                          (gtk_color_selection_dialog_get_color_selection (color_dialog)),
					  &color_button->priv->color);

  gtk_color_selection_set_current_color (GTK_COLOR_SELECTION
                                         (gtk_color_selection_dialog_get_color_selection (color_dialog)),
					 &color_button->priv->color);

  gtk_window_present (GTK_WINDOW (color_button->priv->cs_dialog));
  return 0;
}
开发者ID:brion,项目名称:gnome-system-monitor,代码行数:51,代码来源:gsm_color_button.c


示例11: cb_tsin_cursor_color

static gboolean cb_tsin_cursor_color( GtkWidget *widget,
                                   gpointer   data )
{
   GtkWidget *color_selector = gtk_color_selection_dialog_new (_("詞音游標的顏色"));

   gtk_color_selection_set_current_color(
           GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_selector))),
           &tsin_cursor_gcolor);


#if 0
   g_signal_connect (GTK_OBJECT (color_selector->ok_button),
                     "clicked",
                     G_CALLBACK (cb_save_tsin_cursor_color),
                     (gpointer) color_selector);
#if 1
   g_signal_connect_swapped (GTK_OBJECT (color_selector->ok_button),
                             "clicked",
                             G_CALLBACK (gtk_widget_destroy),
                             (gpointer) color_selector);
#endif
   g_signal_connect_swapped (GTK_OBJECT (color_selector->cancel_button),
                             "clicked",
                             G_CALLBACK (gtk_widget_destroy),
                             (gpointer) color_selector);
#endif

   gtk_widget_show((GtkWidget*)color_selector);
#if 1
   if (gtk_dialog_run(GTK_DIALOG(color_selector)) == GTK_RESPONSE_OK)
     cb_save_tsin_cursor_color((GtkWidget *)color_selector, (gpointer) color_selector);
   gtk_widget_destroy((GtkWidget *)color_selector);
#endif
   return TRUE;
}
开发者ID:Tetralet,项目名称:hime,代码行数:35,代码来源:hime-setup-pho.c


示例12: GetParentForModalDialog

bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
{
    if (data)
        m_data = *data;

    m_parent = GetParentForModalDialog(parent, 0);
    GtkWindow * const parentGTK = m_parent ? GTK_WINDOW(m_parent->m_widget)
                                           : NULL;

    wxString title(_("Choose colour"));
    m_widget = gtk_color_selection_dialog_new(wxGTK_CONV(title));

    g_object_ref(m_widget);

    if ( parentGTK )
    {
        gtk_window_set_transient_for(GTK_WINDOW(m_widget), parentGTK);
    }

    GtkColorSelection* sel = GTK_COLOR_SELECTION(
        gtk_color_selection_dialog_get_color_selection(
        GTK_COLOR_SELECTION_DIALOG(m_widget)));
    gtk_color_selection_set_has_palette(sel, true);

    return true;
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:26,代码来源:colordlg.cpp


示例13: change_color_callback

static void
change_color_callback (GtkWidget *button,
                       gpointer   data)
{
  GtkWidget *dialog;
  GtkColorSelection *colorsel;
  GtkColorSelectionDialog *selection_dialog;
  gint response;

  dialog = gtk_color_selection_dialog_new ("Changing color");

  gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));

  selection_dialog = GTK_COLOR_SELECTION_DIALOG (dialog);
  colorsel = GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (selection_dialog));

  gtk_color_selection_set_previous_rgba (colorsel, &color);
  gtk_color_selection_set_current_rgba (colorsel, &color);
  gtk_color_selection_set_has_palette (colorsel, TRUE);

  response = gtk_dialog_run (GTK_DIALOG (dialog));

  if (response == GTK_RESPONSE_OK)
    {
      gtk_color_selection_get_current_rgba (colorsel, &color);

      gtk_widget_override_background_color (da, 0, &color);
    }

  gtk_widget_destroy (dialog);
}
开发者ID:BYC,项目名称:gtk,代码行数:31,代码来源:colorsel.c


示例14: colsel_ok_clicked_lcb

static void colsel_ok_clicked_lcb(GtkWidget *widget, Tcolsel *csd) { 
	gchar *tmpstr;
	GdkColor gcolor;
	/* only on a OK click we do the setcolor thing */
	gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(csd->csel), &gcolor);

	tmpstr = gdk_color_to_hexstring(&gcolor, FALSE);
	if (csd->bfwin) {
		csd->bfwin->session->colorlist = add_to_stringlist(csd->bfwin->session->colorlist, tmpstr);
	}
	
	if (csd->is_modal) {
		g_free(csd->returnval);
		csd->returnval = tmpstr;
		gtk_main_quit();
	} else {
		if (string_is_color(tmpstr)) {
			if (csd->startpos || csd->endpos) {
				DEBUG_MSG("colsel_ok_clicked_lcb, replacing with %s\n", tmpstr);
				doc_replace_text(csd->bfwin->current_document, tmpstr, csd->startpos, csd->endpos);
			} else {
				DEBUG_MSG("colsel_ok_clicked_lcb, inserting %s\n", tmpstr);
				doc_insert_two_strings(csd->bfwin->current_document,tmpstr, NULL);
			}
		}
		g_free(tmpstr);
		window_destroy(csd->win);
	}
}
开发者ID:Shayan-To,项目名称:bluefish,代码行数:29,代码来源:html2.c


示例15: on_color_change_button_clicked

void
on_color_change_button_clicked (GtkButton * button, gpointer user_data)
{
  GtkTreePath *gpath;
  GtkTreeViewColumn *gcol;
  GtkTreeIter it;
  GdkColor *gdk_color;
  GtkColorSelectionDialog *dlg;
  GtkColorSelection *csel;
  EATreePos ep;

  if (!get_color_store (&ep))
    return;

  /* gets the row (path) at cursor */
  gtk_tree_view_get_cursor (ep.gv, &gpath, &gcol);
  if (!gpath)
    return;			/* no row selected */

  /* get iterator from path */
  if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (ep.gs), &it, gpath))
    return;

  gtk_tree_model_get (GTK_TREE_MODEL (ep.gs), &it, 1, &gdk_color, -1);

  dlg = GTK_COLOR_SELECTION_DIALOG
          (glade_xml_get_widget (appdata.xml, "colorselectiondialog"));

  csel = GTK_COLOR_SELECTION(dlg->colorsel);
  gtk_color_selection_set_current_color(csel, gdk_color);
  gtk_color_selection_set_previous_color(csel, gdk_color);
  
  g_object_set_data( G_OBJECT(dlg), "isadd", GINT_TO_POINTER(FALSE));
  gtk_widget_show (GTK_WIDGET(dlg));
}				/* on_color_change_button_clicked */
开发者ID:IFGHou,项目名称:EtherApe,代码行数:35,代码来源:pref_dialog.c


示例16: color_selection_ok

static void
color_selection_ok (GtkWidget               *w,
                    GtkColorSelectionDialog *cs)
{
  GtkColorSelection *colorsel;
  GdkColor color;
  Color col;

  colorsel=GTK_COLOR_SELECTION(cs->colorsel);

  gtk_color_selection_get_current_color(colorsel,&color);
  GDK_COLOR_TO_DIA(color, col);

  if (edit_color == FOREGROUND) {
    attributes_set_foreground(&col);
  } else {
    attributes_set_background(&col);
  }
  color_area_draw ();

  /*  gtk_color_selection_set_currentcolor(colorsel,&color);*/

  gtk_widget_hide(color_select);
  color_select_active = 0;
}
开发者ID:krattai,项目名称:monoflow,代码行数:25,代码来源:color_area.c


示例17: change_color_cb

static void
change_color_cb(GtkWidget *button, t_sload *sload)
{
    GtkWidget *dialog;
    GtkColorSelection *colorsel;
    gint response;

    dialog = gtk_color_selection_dialog_new("Select color");

    gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(sload->opt_dialog));

    colorsel = GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel);

    gtk_color_selection_set_previous_color(colorsel, &sload->options.color);
    gtk_color_selection_set_current_color(colorsel, &sload->options.color);
    gtk_color_selection_set_has_palette(colorsel, TRUE);

    response = gtk_dialog_run(GTK_DIALOG(dialog));

    if (response == GTK_RESPONSE_OK)
    {
        gtk_color_selection_get_current_color(colorsel, &sload->options.color);
        gtk_widget_modify_bg(sload->opt_da, GTK_STATE_NORMAL, &sload->options.color);
        setup_sload(sload);
    }

    gtk_widget_destroy(dialog);
}
开发者ID:BackupTheBerlios,项目名称:xfce-goodies-svn,代码行数:28,代码来源:systemload.c


示例18: dialog_colour_new

void dialog_colour_new(GtkWidget *w, gdouble *colour)
{
GtkWidget *csd;

/* create colour selection dialog */
csd = gtk_color_selection_dialog_new("Edit colour");

/* set the initial colour */
gtk_color_selection_set_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(csd)->colorsel), colour);

/* value colour update */
g_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(csd)->colorsel), "color_changed",
                 GTK_SIGNAL_FUNC(set_colour_value), (gpointer) colour);
/* widget colour update */
if (w)
  g_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(csd)->colorsel), "color_changed",
                   GTK_SIGNAL_FUNC(set_colour_widget), (gpointer) w);

g_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(csd)->ok_button), "clicked",
                 GTK_SIGNAL_FUNC(destroy_widget), (gpointer) csd);

gtk_widget_hide(GTK_COLOR_SELECTION_DIALOG(csd)->cancel_button);

gtk_widget_show(csd);

/*
g_signal_connect(GTK_OBJECT(w), "destroy", GTK_SIGNAL_FUNC(destroy_widget), csd);
*/
}
开发者ID:Bhattiasif,项目名称:gdis,代码行数:29,代码来源:gui_dialog.c


示例19: GTK_COLOR_SELECTION

void wxColourDialog::ColourDataToDialog()
{
    GtkColorSelection* sel = GTK_COLOR_SELECTION(
        gtk_color_selection_dialog_get_color_selection(
        GTK_COLOR_SELECTION_DIALOG(m_widget)));

    const wxColour& color = m_data.GetColour();
    if (color.IsOk())
    {
#ifdef __WXGTK3__
        gtk_color_selection_set_current_rgba(sel, color);
#else
        gtk_color_selection_set_current_color(sel, color.GetColor());
#endif
    }

    // setup the palette:

    GdkColor colors[wxColourData::NUM_CUSTOM];
    gint n_colors = 0;
    for (unsigned i = 0; i < WXSIZEOF(colors); i++)
    {
        wxColour c = m_data.GetCustomColour(i);
        if (c.IsOk())
        {
            colors[n_colors] = *c.GetColor();
            n_colors++;
        }
    }

    wxGtkString pal(gtk_color_selection_palette_to_string(colors, n_colors));

    GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(sel));
    g_object_set(settings, "gtk-color-palette", pal.c_str(), NULL);
}
开发者ID:hwiesmann,项目名称:wxWidgets,代码行数:35,代码来源:colordlg.cpp


示例20: g_object_new

GtkWidget *roccat_color_selection_dialog_new(GtkWindow *parent) {
	RoccatColorSelectionDialog *color_selection_dialog;
	RoccatColorSelectionDialogPrivate *priv;
	GtkWidget *content_area;

	color_selection_dialog = g_object_new(ROCCAT_COLOR_SELECTION_DIALOG_TYPE, NULL);
	priv = color_selection_dialog->priv;

	gtk_dialog_add_button(GTK_DIALOG(color_selection_dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
	gtk_dialog_add_button(GTK_DIALOG(color_selection_dialog), GTK_STOCK_OK, GTK_RESPONSE_OK);

	gtk_window_set_title(GTK_WINDOW(color_selection_dialog), _("Choose color"));
	gtk_window_set_transient_for(GTK_WINDOW(color_selection_dialog), parent);
	gtk_window_set_modal(GTK_WINDOW(color_selection_dialog), TRUE);
	gtk_window_set_destroy_with_parent(GTK_WINDOW(color_selection_dialog), TRUE);

	priv->multiwidget = ROCCAT_MULTIWIDGET(roccat_multiwidget_new());

	priv->palette_selector = ROCCAT_COLOR_PALETTE_SELECTOR(roccat_color_palette_selector_new());
	roccat_multiwidget_add(priv->multiwidget, GTK_WIDGET(priv->palette_selector));
	g_signal_connect(G_OBJECT(priv->palette_selector), "color-changed", G_CALLBACK(palette_color_changed_cb), color_selection_dialog);

	priv->custom_selector = GTK_COLOR_SELECTION(gtk_color_selection_new());
	roccat_multiwidget_add(priv->multiwidget, GTK_WIDGET(priv->custom_selector));
	g_signal_connect(G_OBJECT(priv->custom_selector), "color-changed", G_CALLBACK(custom_color_changed_cb), color_selection_dialog);

	content_area = gtk_dialog_get_content_area(GTK_DIALOG(color_selection_dialog));
	gtk_box_pack_start(GTK_BOX(content_area), GTK_WIDGET(priv->multiwidget), TRUE, TRUE, 0);
	gtk_widget_show_all(GTK_WIDGET(content_area));

	return GTK_WIDGET(color_selection_dialog);
}
开发者ID:ngg,项目名称:roccat-tools,代码行数:32,代码来源:roccat_color_selection_dialog.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_COLOR_SELECTION_DIALOG函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_COLOR_CHOOSER函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap