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

C++ FREE_TEXT函数代码示例

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

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



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

示例1: clip_GTK_TOOLTIPSSETTIP

/* Adds a tooltip containing the message tip_text to the specified GtkWidget. */
int
clip_GTK_TOOLTIPSSETTIP(ClipMachine * ClipMachineMemory)
{
   C_widget *ctt = _fetch_cw_arg(ClipMachineMemory);

   C_widget *cwid = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2));

   gchar    *tip_text = _clip_parc(ClipMachineMemory, 3);

   gchar    *tip_private = _clip_parc(ClipMachineMemory, 4);

   CHECKCWID(ctt, GTK_IS_TOOLTIPS);
   CHECKARG2(2, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCWID(cwid, GTK_IS_WIDGET);
   CHECKOPT(3, CHARACTER_type_of_ClipVarType);
   CHECKOPT(4, CHARACTER_type_of_ClipVarType);
   LOCALE_TO_UTF(tip_text);
   LOCALE_TO_UTF(tip_private);
   gtk_tooltips_set_tip(GTK_TOOLTIPS(ctt->widget), cwid->widget, tip_text, tip_private);
   FREE_TEXT(tip_text);
   FREE_TEXT(tip_private);
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:26,代码来源:tooltips.c


示例2: clip_GTK_ACTIONGROUPTRANSLATESTRING

int
clip_GTK_ACTIONGROUPTRANSLATESTRING(ClipMachine * ClipMachineMemory)
{
   C_object *cagroup = _fetch_co_arg(ClipMachineMemory);

   gchar    *string = _clip_parc(ClipMachineMemory, 2);

   gchar    *resstr;

   CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCOBJ(cagroup, GTK_IS_ACTION_GROUP(cagroup->object));
   CHECKARG(2, CHARACTER_type_of_ClipVarType);

   LOCALE_TO_UTF(string);
   resstr = (gchar *) gtk_action_group_translate_string(GTK_ACTION_GROUP(cagroup->object), string);
   LOCALE_FROM_UTF(resstr);
   _clip_retc(ClipMachineMemory, resstr);

   FREE_TEXT(string);
   FREE_TEXT(resstr);

   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:25,代码来源:actiongroup.c


示例3: clip_GTK_NOTEBOOKINSERTPAGEMENU

/* Inserts in notebook a new page whose content is child, whose bookmark is
 * tab_label, and whose menu label is menu_label. The page is inserted just
 * before the page number position, starting with 0. If position is out of
 * bounds, it is assumed to be the current number of pages. */
int
clip_GTK_NOTEBOOKINSERTPAGEMENU(ClipMachine * ClipMachineMemory)
{
   C_widget *cntb = _fetch_cw_arg(ClipMachineMemory);

   C_widget *cchild = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2));

   C_widget *ctab_label;

   GtkWidget *tab_label;

   C_widget *cmenu_label;

   GtkWidget *menu_label;

   gint      position = _clip_parni(ClipMachineMemory, 5);

   CHECKCWID(cntb, GTK_IS_NOTEBOOK);
   CHECKARG2(2, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCWID(cchild, GTK_IS_WIDGET);
   CHECKARG3(3, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType, CHARACTER_type_of_ClipVarType);
   CHECKARG3(4, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType, CHARACTER_type_of_ClipVarType);
   CHECKOPT(5, NUMERIC_type_of_ClipVarType);
   if (_clip_parinfo(ClipMachineMemory, 3) == CHARACTER_type_of_ClipVarType)
    {
       char     *caption = _clip_parc(ClipMachineMemory, 3);

       LOCALE_TO_UTF(caption);
       tab_label = gtk_label_new(caption);
       FREE_TEXT(caption);
    }
   else
    {
       ctab_label = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 3));
       CHECKCWID(ctab_label, GTK_IS_WIDGET);
       if (ctab_label)
	  tab_label = ctab_label->widget;
    }
   if (_clip_parinfo(ClipMachineMemory, 4) == CHARACTER_type_of_ClipVarType)
    {
       char     *menu_text = _clip_parc(ClipMachineMemory, 4);

       LOCALE_TO_UTF(menu_text);
       menu_label = gtk_label_new(menu_text);
       FREE_TEXT(menu_text);
    }
   else
    {
       cmenu_label = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 4));
       CHECKCWID(cmenu_label, GTK_IS_WIDGET);
       if (cmenu_label)
	  menu_label = cmenu_label->widget;
    }
   if (_clip_parinfo(ClipMachineMemory, 5) == UNDEF_type_of_ClipVarType)
      position = 1;
   gtk_notebook_insert_page_menu(GTK_NOTEBOOK(cntb->widget), cchild->widget, tab_label, menu_label, position - 1);
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:64,代码来源:notebook.c


示例4: handle_widget_selected_signal

static    gint
handle_widget_selected_signal(GtkWidget * widget, GtkWidget * wid,
			      gchar * tip_text, gchar * tip_private, GdkEventButton * event, C_signal * cs)
{
   C_widget *cwid = _list_get_cwidget(cs->cw->cmachine, wid);

   PREPARECV(cs, cv);
   if (!cwid)
      cwid = _register_widget(cs->cw->cmachine, wid, NULL);
   if (cwid)
      _clip_madd(cs->cw->cmachine, &cv, HASH_WIDGET, &cwid->obj);
   LOCALE_FROM_UTF(tip_text);
   LOCALE_FROM_UTF(tip_private);
   _clip_mputc(cs->cw->cmachine, &cv, HASH_TIPTEXT, tip_text, strlen(tip_text));
   _clip_mputc(cs->cw->cmachine, &cv, HASH_TIPPRIVATE, tip_private, strlen(tip_private));
   _clip_mputn(cs->cw->cmachine, &cv, HASH_BUTTON, event->button);
   _clip_mputn(cs->cw->cmachine, &cv, HASH_X, event->x);
   _clip_mputn(cs->cw->cmachine, &cv, HASH_Y, event->y);
   _clip_mputn(cs->cw->cmachine, &cv, HASH_XROOT, event->x_root);
   _clip_mputn(cs->cw->cmachine, &cv, HASH_YROOT, event->y_root);
   _clip_mputn(cs->cw->cmachine, &cv, HASH_STATE, event->state);
   FREE_TEXT(tip_text);
   FREE_TEXT(tip_private);
   INVOKESIGHANDLER(widget, cs, cv);
}
开发者ID:amery,项目名称:clip-angelo,代码行数:25,代码来源:tipsquery.c


示例5: ippctl_action_mod

static int
ippctl_action_mod(
	char		*aname)
{
	ipp_mod_id_t	mid;
	ipp_action_id_t	aid;
	char		*modname;
	nvlist_t	*nvlp;
	int		ipp_rc;
	int		rc;

	/*
	 * Look up the action id and get the id of the module that
	 * implements the action. If that succeeds then look up the
	 * name of the module.
	 */

	aid = ipp_action_lookup(aname);
	FREE_TEXT(aname);

	if ((ipp_rc = ipp_action_mod(aid, &mid)) == 0)
		ipp_rc = ipp_mod_name(mid, &modname);

	/*
	 * Add an nvlist containing the kernel return code to the
	 * set of nvlists to pass back to libipp.
	 */

	if ((rc = ippctl_set_rc(ipp_rc)) != 0)
		return (rc);

	/*
	 * If everything succeeded add an nvlist containing the
	 * module name to the set of nvlists to pass back to libipp.
	 */

	if (ipp_rc == 0) {
		if ((rc = nvlist_alloc(&nvlp, NV_UNIQUE_NAME, KM_SLEEP)) != 0)
			return (rc);

		if ((rc = ippctl_attach_modname(nvlp, modname)) != 0) {
			nvlist_free(nvlp);
			return (rc);
		}

		FREE_TEXT(modname);

		rc = ippctl_callback(nvlp, NULL);
		nvlist_free(nvlp);
	} else
		rc = 0;

	return (rc);
}
开发者ID:bahamas10,项目名称:openzfs,代码行数:54,代码来源:ippctl.c


示例6: ippctl_action_create

static int
ippctl_action_create(
	char		*modname,
	char		*aname,
	nvlist_t	*nvlp,
	ipp_flags_t	flags)
{
	int		ipp_rc;
	int		rc;
	ipp_mod_id_t	mid;
	ipp_action_id_t	aid;

	/*
	 * Look up the module id from the name and create the new
	 * action.
	 */

	mid = ipp_mod_lookup(modname);
	FREE_TEXT(modname);

	ipp_rc = ipp_action_create(mid, aname, &nvlp, flags, &aid);
	FREE_TEXT(aname);

	/*
	 * Add an nvlist containing the kernel return code to the
	 * set of nvlists to pass back to libipp.
	 */

	if ((rc = ippctl_set_rc(ipp_rc)) != 0) {
		if (nvlp != NULL) {
			nvlist_free(nvlp);
			if (ipp_action_destroy(aid, 0) != 0) {
				cmn_err(CE_PANIC,
				    "ippctl: unrecoverable error (aid = %d)",
				    aid);
				/*NOTREACHED*/
			}
		}
		return (rc);
	}

	/*
	 * If the module passed back an nvlist, add this as
	 * well.
	 */

	if (nvlp != NULL) {
		rc = ippctl_callback(nvlp, NULL);
		nvlist_free(nvlp);
	} else
		rc = 0;

	return (rc);
}
开发者ID:bahamas10,项目名称:openzfs,代码行数:54,代码来源:ippctl.c


示例7: clip_GTK_TOGGLEACTIONNEW

int
clip_GTK_TOGGLEACTIONNEW(ClipMachine * ClipMachineMemory)
{
   ClipVar  *cv = _clip_spar(ClipMachineMemory, 1);

   gchar    *name = _clip_parc(ClipMachineMemory, 2);

   gchar    *label = _clip_parc(ClipMachineMemory, 3);

   gchar    *tooltip = _clip_parc(ClipMachineMemory, 4);

   gchar    *stock_id = _clip_parc(ClipMachineMemory, 5);

   C_object *caction;

   GtkToggleAction *action;

   CHECKOPT(1, MAP_type_of_ClipVarType);
   CHECKARG(2, CHARACTER_type_of_ClipVarType);
   CHECKARG(3, CHARACTER_type_of_ClipVarType);
   CHECKOPT(4, CHARACTER_type_of_ClipVarType);
   CHECKOPT(5, CHARACTER_type_of_ClipVarType);

   LOCALE_TO_UTF(name);
   LOCALE_TO_UTF(label);
   if (tooltip)
      LOCALE_TO_UTF(tooltip);
   if (stock_id)
      LOCALE_TO_UTF(stock_id);

   action = gtk_toggle_action_new(name, label, tooltip, stock_id);

   if (action)
    {
       caction = _list_get_cobject(ClipMachineMemory, action);
       if (!caction)
	  caction = _register_object(ClipMachineMemory, action, GTK_TYPE_TOGGLE_ACTION, cv, NULL);
       if (caction)
	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &caction->obj);
    }

   FREE_TEXT(name);
   FREE_TEXT(label);
   if (tooltip)
      FREE_TEXT(tooltip);
   if (stock_id)
      FREE_TEXT(stock_id);
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:51,代码来源:toggleaction.c


示例8: handle_widget_entered_signal

/* Signal handlers */
static gint
handle_widget_entered_signal (GtkWidget *widget, GtkWidget *wid, gchar *tip_text, gchar *tip_private, C_signal *cs)
{
	C_widget *cwid = _list_get_cwidget(cs->cw->cmachine,wid);
	PREPARECV(cs,cv);
        if (!cwid) cwid = _register_widget(cs->cw->cmachine,wid,NULL);
	if (cwid) _clip_madd(cs->cw->cmachine, &cv, HASH_WIDGET, &cwid->obj);
	LOCALE_FROM_UTF(tip_text);
	LOCALE_FROM_UTF(tip_private);
	_clip_mputc(cs->cw->cmachine, &cv, HASH_TIPTEXT, tip_text, strlen(tip_text));
	_clip_mputc(cs->cw->cmachine, &cv, HASH_TIPPRIVATE, tip_private, strlen(tip_private));
       	FREE_TEXT(tip_text);
       	FREE_TEXT(tip_private);
        INVOKESIGHANDLER(widget,cs,cv);
}
开发者ID:amery,项目名称:clip-itk,代码行数:16,代码来源:tipsquery.c


示例9: clip_GTK_TOOLTIPSDATAGET

/* Retrieves any GtkTooltipsData previously associated with the given widget. */
int
clip_GTK_TOOLTIPSDATAGET(ClipMachine * ClipMachineMemory)
{
   C_widget *cwid = _fetch_cw_arg(ClipMachineMemory);

   GtkTooltipsData *data;

   CHECKCWID(cwid, GTK_IS_WIDGET);
   data = gtk_tooltips_data_get(cwid->widget);
   if (data)
    {
       C_widget *ctt = _list_get_cwidget(ClipMachineMemory, data->tooltips);

       C_object *cfont = _list_get_cobject(ClipMachineMemory, data->font);

       ClipVar  *ret = RETPTR(ClipMachineMemory);

       char     *tip_text = data->tip_text ? data->tip_text : "";

       char     *tip_private = data->tip_private ? data->tip_private : "";

       memset(ret, 0, sizeof(*ret));
       _clip_map(ClipMachineMemory, ret);
       if (!ctt)
	  ctt = _register_widget(ClipMachineMemory, (GtkWidget *) (data->tooltips), NULL);
       if (ctt)
	  _clip_madd(ClipMachineMemory, ret, HASH_TOOLTIPS, &ctt->obj);
       if (!cfont)
	  cfont =
	   _register_object(ClipMachineMemory, data->font, GDK_OBJECT_FONT, NULL, (coDestructor) gdk_object_font_destructor);
       if (cfont)
	{
	   cfont->ref_count = 1;
	   _clip_madd(ClipMachineMemory, ret, HASH_FONT, &cfont->obj);
	}
       _clip_madd(ClipMachineMemory, ret, HASH_WIDGET, &cwid->obj);
       LOCALE_FROM_UTF(tip_text);
       LOCALE_FROM_UTF(tip_private);
       _clip_mputc(ClipMachineMemory, ret, HASH_TIPTEXT, tip_text, strlen(tip_text));
       _clip_mputc(ClipMachineMemory, ret, HASH_TIPPRIVATE, tip_private, strlen(tip_private));
       _clip_mputn(ClipMachineMemory, ret, HASH_WIDTH, data->width);
       FREE_TEXT(tip_text);
       FREE_TEXT(tip_private);
    }
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:49,代码来源:tooltips.c


示例10: clip_GTK_NOTEBOOKSETMENULABEL

/* Changes the menu label of child. Nothing happens if child is not in notebook. */
int
clip_GTK_NOTEBOOKSETMENULABEL(ClipMachine * ClipMachineMemory)
{
   C_widget *cntb = _fetch_cw_arg(ClipMachineMemory);

   C_widget *cchild = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2));

   C_widget *clabel;

   CHECKCWID(cntb, GTK_IS_NOTEBOOK);
   CHECKARG2(2, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCWID(cchild, GTK_IS_WIDGET);
   CHECKARG3(3, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType, CHARACTER_type_of_ClipVarType);
   if (_clip_parinfo(ClipMachineMemory, 3) == CHARACTER_type_of_ClipVarType)
    {
       char     *menu_text = _clip_parc(ClipMachineMemory, 3);

       LOCALE_TO_UTF(menu_text);
       gtk_notebook_set_menu_label_text(GTK_NOTEBOOK(cntb->widget), cchild->widget, menu_text);
       FREE_TEXT(menu_text);
    }
   else
    {
       clabel = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 3));
       CHECKCWID(clabel, GTK_IS_WIDGET);
       if (clabel)
	  gtk_notebook_set_menu_label(GTK_NOTEBOOK(cntb->widget), cchild->widget, clabel->widget);

    }
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:34,代码来源:notebook.c


示例11: clip_GTK_ACTIONGROUPNEW

int
clip_GTK_ACTIONGROUPNEW(ClipMachine * ClipMachineMemory)
{
   ClipVar  *cv = _clip_spar(ClipMachineMemory, 1);

   gchar    *name = _clip_parc(ClipMachineMemory, 2);

   C_object *cagroup;

   GtkActionGroup *agroup;

   CHECKOPT(1, MAP_type_of_ClipVarType);
   CHECKARG(2, CHARACTER_type_of_ClipVarType);

   LOCALE_TO_UTF(name);

   agroup = gtk_action_group_new(name);

   if (agroup)
    {
       cagroup = _list_get_cobject(ClipMachineMemory, agroup);
       if (!cagroup)
	  cagroup = _register_object(ClipMachineMemory, agroup, GTK_TYPE_ACTION_GROUP, cv, NULL);
       if (cagroup)
	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cagroup->obj);
    }

   FREE_TEXT(name);
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:32,代码来源:actiongroup.c


示例12: clip_GTK_NOTEBOOKPREPENDPAGE

/* Prepends to notebook a page whose content is child, and whose
 * bookmark is label. */
int
clip_GTK_NOTEBOOKPREPENDPAGE(ClipMachine * ClipMachineMemory)
{
   C_widget *cntb = _fetch_cw_arg(ClipMachineMemory);

   C_widget *cchild = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2));

   C_widget *clabel;

   GtkWidget *label;

   CHECKCWID(cntb, GTK_IS_NOTEBOOK);
   CHECKARG2(2, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCWID(cchild, GTK_IS_WIDGET);
   CHECKARG3(3, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType, CHARACTER_type_of_ClipVarType);
   if (_clip_parinfo(ClipMachineMemory, 3) == CHARACTER_type_of_ClipVarType)
    {
       char     *caption = _clip_parc(ClipMachineMemory, 3);

       LOCALE_TO_UTF(caption);
       label = gtk_label_new(caption);
       FREE_TEXT(caption);
    }
   else
    {
       clabel = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 3));
       CHECKCWID(clabel, GTK_IS_WIDGET);
       if (clabel)
	  label = clabel->widget;
    }
   gtk_notebook_prepend_page(GTK_NOTEBOOK(cntb->widget), cchild->widget, label);
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:37,代码来源:notebook.c


示例13: clip_GTK_ICONTHEMEGETICONSIZES

int
clip_GTK_ICONTHEMEGETICONSIZES(ClipMachine * cm)
{
        C_object  *cicon  = _fetch_co_arg(cm);
        gchar *icon_name  = _clip_parc(cm, 2);
        ClipVar     *cv   = RETPTR(cm);
        gint         *a   ;

	CHECKCOBJ(cicon, GTK_IS_ICON_THEME(cicon->object));
        CHECKARG(2, CHARACTER_t);

	LOCALE_TO_UTF(icon_name);
	a = gtk_icon_theme_get_icon_sizes(GTK_ICON_THEME(cicon->object), icon_name);
        FREE_TEXT(icon_name);

	_clip_array(cm, cv, 0, 0);
	while (a)
	{
		ClipVar *item;
		item = NEW(ClipVar);
		item->t.type = NUMERIC_t;
		item->t.flags = 0;
		item->n.d = a[0];
		_clip_aadd(cm, cv, item);
		_clip_delete(cm, item);
                a++;
	}

	free(a);

	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:34,代码来源:icontheme.c


示例14: ippctl_action_destroy

static int
ippctl_action_destroy(
	char		*aname,
	ipp_flags_t	flags)
{
	ipp_action_id_t	aid;
	int		ipp_rc;
	int		rc;

	/*
	 * Look up the action id and destroy the action.
	 */

	aid = ipp_action_lookup(aname);
	FREE_TEXT(aname);

	ipp_rc = ipp_action_destroy(aid, flags);

	/*
	 * Add an nvlist containing the kernel return code to the
	 * set of nvlists to pass back to libipp.
	 */

	if ((rc = ippctl_set_rc(ipp_rc)) != 0)
		return (rc);

	/*
	 * There's no more information to pass back.
	 */

	return (0);
}
开发者ID:bahamas10,项目名称:openzfs,代码行数:32,代码来源:ippctl.c


示例15: clip_GTK_IMAGEMENUITEMNEWWITHMNEMONIC

int
clip_GTK_IMAGEMENUITEMNEWWITHMNEMONIC(ClipMachine * cm)
{
	ClipVar        *cv = _clip_spar(cm, 1);
        gchar       *label = _clip_parc(cm, 2);
        C_widget   *cimage ;
        GtkWidget   *image ;

	CHECKOPT(1,MAP_t);
        CHECKARG(2, CHARACTER_t);

	LOCALE_TO_UTF(label);
	image = gtk_image_menu_item_new_with_mnemonic(label);

	if (image)
        {
        	cimage = _list_get_cwidget(cm, image);
                if (!cimage) cimage = _register_widget(cm, image, cv);
                if (cimage) _clip_mclone(cm, RETPTR(cm), &cimage->obj);
        }
        FREE_TEXT(label);
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:25,代码来源:imagemenuitem.c


示例16: clip_GTK_INPUTDIALOGNEW

/****  INPUT DIALOG constructor ****/
int
clip_GTK_INPUTDIALOGNEW(ClipMachine * ClipMachineMemory)
{
   ClipVar  *cv = _clip_spar(ClipMachineMemory, 1);

   char     *title = _clip_parc(ClipMachineMemory, 2);

   GtkWidget *wid = NULL;

   C_widget *cwid;

   CHECKOPT(1, MAP_type_of_ClipVarType);
   CHECKOPT(2, CHARACTER_type_of_ClipVarType);

   wid = gtk_input_dialog_new();
   if (!wid)
      goto err;
   if (_clip_parinfo(ClipMachineMemory, 2) == CHARACTER_type_of_ClipVarType)
    {
       LOCALE_TO_UTF(title);
       gtk_window_set_title(GTK_WINDOW(wid), title);
       FREE_TEXT(title);
    }
  //cwid = (C_widget*)calloc( 1, sizeof(C_widget) );
   cwid = _register_widget(ClipMachineMemory, wid, cv);

   _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:32,代码来源:dialog.c


示例17: clip_GTK_WINDOWNEW

/****  WINDOW constructor ****/
int
clip_GTK_WINDOWNEW(ClipMachine * cm)
{
	ClipVar * cv   = _clip_spar(cm, 1);
	char * title   = _clip_parc(cm, 2);
	gint     typ   = INT_OPTION(cm, 3, 0);
	GtkWidget *wid = NULL;
	C_widget *cwid;
	CHECKOPT(1,MAP_t);
	CHECKOPT(2,CHARACTER_t);
	CHECKOPT(3,NUMERIC_t);

	//wid = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	wid = gtk_window_new(typ);
	if (!wid) goto err;
	if (_clip_parinfo(cm,2)==CHARACTER_t)
		{
		LOCALE_TO_UTF(title);
		gtk_window_set_title(GTK_WINDOW(wid), title);
		FREE_TEXT(title);
		}
	//cwid = (C_widget*)calloc( 1, sizeof(C_widget) );
	cwid = _register_widget(cm, wid, cv);
	cwid->accel_group = gtk_accel_group_new();
	gtk_window_add_accel_group (GTK_WINDOW (wid), cwid->accel_group);
//	gtk_signal_connect( GTK_OBJECT( wid ), "delete-event",
//		GTK_SIGNAL_FUNC( delete_window_handler ), NULL );

	_clip_mclone(cm,RETPTR(cm),&cwid->obj);
	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:34,代码来源:window.c


示例18: clip_GTK_TREEITEMNEW

/**** TREE ITEM constructor ****/
int
clip_GTK_TREEITEMNEW(ClipMachine * ClipMachineMemory)
{
   ClipVar  *cv = _clip_spar(ClipMachineMemory, 1);

   char     *label = _clip_parc(ClipMachineMemory, 2);

   GtkWidget *wid = NULL;

   C_widget *cwid;

   CHECKOPT(1, MAP_type_of_ClipVarType);
   CHECKOPT(2, CHARACTER_type_of_ClipVarType);

   if (_clip_parinfo(ClipMachineMemory, 2) == CHARACTER_type_of_ClipVarType)
    {
       LOCALE_TO_UTF(label);
       wid = gtk_tree_item_new_with_label(label);
       FREE_TEXT(label);
    }
   else
      wid = gtk_tree_item_new();
   if (!wid)
      goto err;

   cwid = _register_widget(ClipMachineMemory, wid, cv);
   _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);

   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:33,代码来源:treeitem.c


示例19: clip_GTK_BUTTONNEW

/**** BUTTON constructor ****/
int
clip_GTK_BUTTONNEW(ClipMachine * ClipMachineMemory)
{
    ClipVar  *cv = _clip_spar(ClipMachineMemory, 1);

    char     *title = _clip_parc(ClipMachineMemory, 2);

    char     *pchar = _clip_parc(ClipMachineMemory, 3);

    GtkWidget *wid = NULL, *label = NULL;

    C_widget *cwid, *clabel = NULL;

    guint     accel_key = 0;

    CHECKOPT(1, MAP_type_of_ClipVarType);
    CHECKOPT(2, CHARACTER_type_of_ClipVarType);
    CHECKOPT(3, CHARACTER_type_of_ClipVarType);

    if (pchar)
    {
        unsigned char *pc;

        for (pc = (unsigned char *) title; pc && *pc; pc++)
            if (*pc == *pchar)
            {
                *pc = '_';
                accel_key = *(pc + 1);
            }
    }
    if (_clip_parinfo(ClipMachineMemory, 2) == CHARACTER_type_of_ClipVarType)
    {
        LOCALE_TO_UTF(title);
        wid = gtk_button_new_with_label(title);
        label = GTK_BIN(&(GTK_BUTTON(wid)->bin))->child;
        if (pchar)
            accel_key = gtk_label_parse_uline(GTK_LABEL(label), title);
        FREE_TEXT(title);
    }
    else
    {
        wid = gtk_button_new();
    }
    if (!wid)
        goto err;

    cwid = _register_widget(ClipMachineMemory, wid, cv);

    if (label)
        clabel = _register_widget(ClipMachineMemory, label, NULL);
    if (clabel)
        _clip_madd(ClipMachineMemory, &cwid->obj, HASH_LABEL, &clabel->obj);

    _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cwid->obj);
    _clip_mputn(ClipMachineMemory, &cwid->obj, HASH_ACCELKEY, accel_key);

    return 0;
err:
    return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:61,代码来源:button.c


示例20: clip_GTK_LABELNEW

/**** LABEL constructor ****/
int
clip_GTK_LABELNEW(ClipMachine * cm)
{
	ClipVar * cv   = _clip_spar(cm, 1);
	char  * text   = _clip_parc(cm, 2);
	char * pchar   = _clip_parc(cm, 3);
	guint accel_key = 0;
	GtkWidget *wid = NULL;
	C_widget *cwid;
	CHECKOPT(1,MAP_t);
	CHECKOPT(2,CHARACTER_t); CHECKOPT(3,CHARACTER_t);

	if (pchar)
	{
		char *pc;
		for (pc = text;pc && *pc; pc++)
			if (*pc == *pchar)
				*pc='_';
	}
	LOCALE_TO_UTF(text);
	wid = gtk_label_new(text);
	if (!wid) goto err;
	if (pchar)
		accel_key = gtk_label_parse_uline(GTK_LABEL(wid),text);
	FREE_TEXT(text);

	cwid = _register_widget(cm, wid, cv);
	_clip_mclone(cm,RETPTR(cm),&cwid->obj);
	_clip_mputn(cm,&cwid->obj,HASH_ACCELKEY,accel_key);

	return 0;
err:
	return 1;
}
开发者ID:amery,项目名称:clip-itk,代码行数:35,代码来源:label.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ FROM_SYSBUS函数代码示例发布时间:2022-05-30
下一篇:
C++ FREE_OBJ函数代码示例发布时间: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