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

C++ GTK_WIDGET_REALIZED函数代码示例

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

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



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

示例1: sexy_icon_entry_size_allocate

static void
sexy_icon_entry_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
{
	g_return_if_fail(SEXY_IS_ICON_ENTRY(widget));
	g_return_if_fail(allocation != NULL);

	widget->allocation = *allocation;

	GTK_WIDGET_CLASS(parent_class)->size_allocate(widget, allocation);

	if (GTK_WIDGET_REALIZED(widget))
		place_windows(SEXY_ICON_ENTRY(widget), allocation);
}
开发者ID:ib,项目名称:xarchiver,代码行数:13,代码来源:sexy-icon-entry.c


示例2: draw

/* When widget is exposed it's contents are redrawn. */
static gint draw(GtkWidget *widget, GdkEventExpose *event)
{
	static gint i = 0;
	i++;
	if (!GTK_IS_WIDGET(widget)) return TRUE;
	if(!GTK_WIDGET_REALIZED(widget)) return TRUE;
	/* Draw only last expose. */
	if (event->count > 0) return FALSE;

	redraw(widget,NULL); 

	return FALSE;
}
开发者ID:xomachine,项目名称:gabedit,代码行数:14,代码来源:GLArea.c


示例3: gtk_redraw_frame_toolbars

static void
gtk_redraw_frame_toolbars (struct frame *f)
{
  /* There are certain startup paths that lead to update_EmacsFrame in
     faces.c being called before a new frame is fully initialized.  In
     particular before we have actually mapped it.  That routine can
     call this one.  So, we need to make sure that the frame is
     actually ready before we try and draw all over it. */

  if (GTK_WIDGET_REALIZED (FRAME_GTK_TEXT_WIDGET (f)))
    gtk_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f),
				 FRAME_PIXHEIGHT (f));
}
开发者ID:boukeversteegh,项目名称:chise,代码行数:13,代码来源:toolbar-gtk.c


示例4: git_source_view_on_adj_changed

static void
git_source_view_on_adj_changed (GtkAdjustment *adj, GitSourceView *sview)
{
  GitSourceViewPrivate *priv = sview->priv;

  if (priv->hadjustment)
    priv->x_offset = priv->hadjustment->value;
  if (priv->vadjustment)
    priv->y_offset = priv->vadjustment->value;

  if (GTK_WIDGET_REALIZED (GTK_WIDGET (sview)))
    gdk_window_invalidate_rect (GTK_WIDGET (sview)->window, NULL, FALSE);
}
开发者ID:bpeel,项目名称:blame-browse,代码行数:13,代码来源:git-source-view.c


示例5: ui_update

static gboolean
ui_update(Bubblemon *base)
{
  int w, h, i;
  const bubblemon_picture_t *bubblePic;
  bubblemon_color_t *pixel;
  guchar *p;

  GdkGC *gc;

  GtkWidget *draw_area = base->draw_area;

  if((draw_area == NULL) ||
     !GTK_WIDGET_REALIZED(draw_area) ||
     !GTK_WIDGET_DRAWABLE(draw_area) ||
     base->width <= 0)
    {
      return TRUE;
    }

  bubblePic = bubblemon_getPicture(base->bubblemon);
  if ((bubblePic == NULL) ||
      (bubblePic->width == 0) ||
      (bubblePic->pixels == 0))
    {
      return TRUE;
    }
  w = bubblePic->width;
  h = bubblePic->height;

  gc = gdk_gc_new(draw_area->window);

  p = base->rgb_buffer;
  pixel = bubblePic->pixels;
  for(i = 0; i < w * h; i++) {
    *(p++) = pixel->components.r;
    *(p++) = pixel->components.g;
    *(p++) = pixel->components.b;
    pixel++;
  }

  gdk_draw_rgb_image(draw_area->window, gc,
                     0, 0,
                     base->width, base->height,
                     GDK_RGB_DITHER_NORMAL,
                     base->rgb_buffer, w * 3);

  gdk_gc_destroy(gc);

  return TRUE;
}
开发者ID:hdfssk,项目名称:bubblemon,代码行数:51,代码来源:ui.c


示例6: ensure_buddy_pix

void ensure_buddy_pix (GtkWidget *window, int n) {
  int width, height;
  GdkGC *white_gc;
  int pri;
  int sec;

  if (!buddy_pix[1].pix)	/* not initialized */
    return;

  if (n < 0 || n > 9 || buddy_pix[n].pix)
    return;

  sec = ((n & 0x04) != 0)? 0x04 : 0x02;
  pri = n & ~sec;

  ensure_buddy_pix (window, pri);

  if (!pri || !sec)
    return;

  if (!GTK_WIDGET_REALIZED (window))
    gtk_widget_realize (window);

  gdk_window_get_size (buddy_pix[1].pix, &width, &height);

  buddy_pix[n].pix = gdk_pixmap_new (window->window, width, height, -1);
  buddy_pix[n].mask = gdk_pixmap_new (window->window, width, height, 1);

  white_gc = window->style->white_gc;

  if (!masks_gc) {
    masks_gc = gdk_gc_new (buddy_pix[n].mask);
    gdk_gc_set_exposures (masks_gc, FALSE);
  }

  gdk_gc_set_foreground (masks_gc, &window->style->white);

  gdk_draw_pixmap (buddy_pix[n].pix, white_gc, buddy_pix[pri].pix,
                                                   0, 0, 0, 0, width, height);
  gdk_draw_pixmap (buddy_pix[n].mask, masks_gc, buddy_pix[pri].mask,
                                                   0, 0, 0, 0, width, height);

  gdk_gc_set_clip_mask (white_gc, buddy_pix[sec].mask);
  gdk_draw_pixmap (buddy_pix[n].pix, white_gc, buddy_pix[sec].pix,
                                                   0, 0, 0, 0, width, height);
  gdk_gc_set_clip_mask (white_gc, NULL);

  gdk_gc_set_clip_mask (masks_gc, buddy_pix[sec].mask);
  gdk_draw_rectangle (buddy_pix[n].mask, masks_gc, TRUE, 0, 0, width, height);
  gdk_gc_set_clip_mask (masks_gc, NULL);
}
开发者ID:svn2github,项目名称:xqf,代码行数:51,代码来源:pixmaps.c


示例7: thunar_sbr_number_renamer_update

static void
thunar_sbr_number_renamer_update (ThunarSbrNumberRenamer *number_renamer)
{
  gboolean invalid = TRUE;
  GdkColor back;
  GdkColor text;
  gchar   *endp;

  /* check whether "start" is valid for the "mode" */
  if (number_renamer->mode < THUNAR_SBR_NUMBER_MODE_ABC)
    {
      /* "start" must be a positive number */
      strtoul (number_renamer->start, &endp, 10);
      invalid = (endp <= number_renamer->start || *endp != '\0');
    }
  else if (number_renamer->mode == THUNAR_SBR_NUMBER_MODE_ABC)
    {
      /* "start" property must be 'a', 'b', 'c', etc. */
      invalid = (strlen (number_renamer->start) != 1
              || g_ascii_tolower (*number_renamer->start) < 'a'
              || g_ascii_tolower (*number_renamer->start) > 'z');
    }

  /* check if the start entry is realized */
  if (GTK_WIDGET_REALIZED (number_renamer->start_entry))
    {
      /* check if the "start" value is valid */
      if (G_UNLIKELY (invalid))
        {
          /* if GTK+ wouldn't be that stupid with style properties and 
           * type plugins, this would be themable, but unfortunately
           * GTK+ is totally broken, and so it's hardcoded.
           */
          gdk_color_parse ("#ff6666", &back);
          gdk_color_parse ("White", &text);

          /* setup a red background/text color to indicate the error */
          gtk_widget_modify_base (number_renamer->start_entry, GTK_STATE_NORMAL, &back);
          gtk_widget_modify_text (number_renamer->start_entry, GTK_STATE_NORMAL, &text);
        }
      else
        {
          /* reset background/text color */
          gtk_widget_modify_base (number_renamer->start_entry, GTK_STATE_NORMAL, NULL);
          gtk_widget_modify_text (number_renamer->start_entry, GTK_STATE_NORMAL, NULL);
        }
    }

  /* notify everybody that we have a new state */
  thunarx_renamer_changed (THUNARX_RENAMER (number_renamer));
}
开发者ID:flipcoder,项目名称:thunar,代码行数:51,代码来源:thunar-sbr-number-renamer.c


示例8: calf_keyboard_size_allocate

static void
calf_keyboard_size_allocate (GtkWidget *widget,
                           GtkAllocation *allocation)
{
    // CalfKeyboard *self = CALF_KEYBOARD(widget);
    g_assert(CALF_IS_KEYBOARD(widget));
    widget->allocation = *allocation;
    widget->allocation.width = widget->requisition.width;
    
    if (GTK_WIDGET_REALIZED(widget))
        gdk_window_move_resize(widget->window, 
            allocation->x + (allocation->width - widget->allocation.width) / 2, allocation->y, 
            widget->allocation.width, allocation->height );
}
开发者ID:SimonTait,项目名称:calf32,代码行数:14,代码来源:ctl_keyboard.cpp


示例9: gv_tool_set_cursor

void
gv_tool_set_cursor(GvTool *tool, gint cursor_type)
{
    if (tool->cursor != NULL)
        gdk_cursor_destroy(tool->cursor);

    tool->cursor = gdk_cursor_new(cursor_type);

    if ((tool->view != NULL) && (GTK_WIDGET_REALIZED(GTK_WIDGET(tool->view))))
    {
	gdk_window_set_cursor(GTK_WIDGET(tool->view)->window, tool->cursor);
    }

}
开发者ID:Onjrew,项目名称:OpenEV,代码行数:14,代码来源:gvtool.c


示例10: matenu_global_menu_item_sync_monitor_num

static gboolean matenu_global_menu_item_sync_monitor_num (MatenuGlobalMenuItem* self) {
	gboolean result = FALSE;
	GdkScreen* screen;
	g_return_val_if_fail (self != NULL, FALSE);
	screen = _g_object_ref0 (gtk_widget_get_screen ((GtkWidget*) self));
	if (GTK_WIDGET_REALIZED ((GtkWidget*) self)) {
		matenu_monitor_set_monitor_num (self->priv->active_window_monitor, gdk_screen_get_monitor_at_window (screen, ((GtkWidget*) self)->window));
	} else {
		matenu_monitor_set_monitor_num (self->priv->active_window_monitor, -1);
	}
	result = FALSE;
	_g_object_unref0 (screen);
	return result;
}
开发者ID:Extraterrestrial,项目名称:mate-globalmenu,代码行数:14,代码来源:globalmenuitem.c


示例11: gtk_mng_view_size_allocate

static void
gtk_mng_view_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
{
    FUNCTION_ENTRY();
  g_return_if_fail (IS_GTK_MNG_VIEW (widget));
  g_return_if_fail (allocation != NULL);

  if (GTK_WIDGET_REALIZED (widget))
    gdk_window_move_resize (widget->window,
			    allocation->x,
			    allocation->y,
			    allocation->width,
			    allocation->height);
}
开发者ID:AlexKordic,项目名称:sandbox,代码行数:14,代码来源:gtk-mng-view.c


示例12: gtk_moz_embed_open_stream

void
gtk_moz_embed_open_stream(GtkMozEmbed *embed, const char *base_uri,
			  const char *mime_type)
{
  EmbedPrivate *embedPrivate;

  g_return_if_fail (embed != NULL);
  g_return_if_fail (GTK_IS_MOZ_EMBED(embed));
  g_return_if_fail (GTK_WIDGET_REALIZED(GTK_WIDGET(embed)));

  embedPrivate = (EmbedPrivate *)embed->data;

  embedPrivate->OpenStream(base_uri, mime_type);
}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:14,代码来源:gtkmozembed2.cpp


示例13: gtk_check_item_size_allocate

static void
gtk_check_item_size_allocate (GtkWidget     *widget,
				GtkAllocation *allocation)
{
  GtkCheckItem *check_item;
  GtkToggleButton *toggle_button;
  GtkButton *button;
  GtkAllocation child_allocation;
  
  g_return_if_fail (widget != NULL);
  g_return_if_fail (GTK_IS_CHECK_ITEM (widget));
  g_return_if_fail (allocation != NULL);
  
  check_item = GTK_CHECK_ITEM (widget);
  toggle_button = GTK_TOGGLE_BUTTON (widget);

  if (toggle_button->draw_indicator)
    {
      widget->allocation = *allocation;
      if (GTK_WIDGET_REALIZED (widget))
	gdk_window_move_resize (toggle_button->event_window,
				allocation->x, allocation->y,
				allocation->width, allocation->height);
      
      button = GTK_BUTTON (widget);
      
      if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
	{
	  child_allocation.x = (GTK_CONTAINER (widget)->border_width +
				CHECK_ITEM_CLASS (widget)->indicator_size +
				CHECK_ITEM_CLASS (widget)->indicator_spacing * 3 + 1 +
				widget->allocation.x);
	  child_allocation.y = GTK_CONTAINER (widget)->border_width + 1 +
	    widget->allocation.y;
	  child_allocation.width = MAX (1, allocation->width - 
					(GTK_CONTAINER (widget)->border_width +
					 CHECK_ITEM_CLASS (widget)->indicator_size +
					 CHECK_ITEM_CLASS (widget)->indicator_spacing * 3 + 1)  -
					GTK_CONTAINER (widget)->border_width - 1);
	  child_allocation.height = MAX (1, allocation->height - (GTK_CONTAINER (widget)->border_width + 1) * 2);
	  
	  gtk_widget_size_allocate (GTK_BIN (button)->child, &child_allocation);
	}
    }
  else
    {
      if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
	(* GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation);
    }
}
开发者ID:Onjrew,项目名称:OpenEV,代码行数:50,代码来源:gtkcheckitem.c


示例14: update_child_count

static void
update_child_count (TrayData *data)
{
  guint n_children = 0;
  char text[64];

  if (!GTK_WIDGET_REALIZED (data->window))
    return;

  gtk_container_foreach (GTK_CONTAINER (data->box), (GtkCallback) do_add, &n_children);

  g_snprintf (text, sizeof (text), "%u icons", n_children);
  gtk_label_set_text (data->count_label, text);
}
开发者ID:mariodebian,项目名称:gdm3,代码行数:14,代码来源:testtray.c


示例15: gtk_form_attach_child_window

    static void
gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
{
    if (child->window != NULL)
	return; /* been there, done that */

    if (GTK_WIDGET_NO_WINDOW(child->widget))
    {
	GtkWidget	*widget;
	GdkWindowAttr	attributes;
	gint		attributes_mask;

	widget = GTK_WIDGET(form);

	attributes.window_type = GDK_WINDOW_CHILD;
	attributes.x = child->x;
	attributes.y = child->y;
	attributes.width = child->widget->requisition.width;
	attributes.height = child->widget->requisition.height;
	attributes.wclass = GDK_INPUT_OUTPUT;
	attributes.visual = gtk_widget_get_visual(widget);
	attributes.colormap = gtk_widget_get_colormap(widget);
	attributes.event_mask = GDK_EXPOSURE_MASK;

	attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
	child->window = gdk_window_new(form->bin_window,
				       &attributes, attributes_mask);
	gdk_window_set_user_data(child->window, widget);

	gtk_style_set_background(widget->style,
				 child->window,
				 GTK_STATE_NORMAL);

	gtk_widget_set_parent_window(child->widget, child->window);
	gtk_form_set_static_gravity(child->window, TRUE);
	/*
	 * Install signal handlers to map/unmap child->window
	 * alongside with the actual widget.
	 */
	gtk_signal_connect(GTK_OBJECT(child->widget), "map",
			   GTK_SIGNAL_FUNC(&gtk_form_child_map), child);
	gtk_signal_connect(GTK_OBJECT(child->widget), "unmap",
			   GTK_SIGNAL_FUNC(&gtk_form_child_unmap), child);
    }
    else if (!GTK_WIDGET_REALIZED(child->widget))
    {
	gtk_widget_set_parent_window(child->widget, form->bin_window);
    }
}
开发者ID:11liju,项目名称:macvim,代码行数:49,代码来源:gui_gtk_f.c


示例16: vf_thumb_next

static gboolean vf_thumb_next(ViewFile *vf)
{
	FileData *fd = NULL;

#if GTK_CHECK_VERSION(2,20,0)
	if (!gtk_widget_get_realized(vf->listview))
#else
	if (!GTK_WIDGET_REALIZED(vf->listview))
#endif
		{
		vf_thumb_status(vf, 0.0, NULL);
		return FALSE;
		}

	switch (vf->type)
	{
	case FILEVIEW_LIST: fd = vflist_thumb_next_fd(vf); break;
	case FILEVIEW_ICON: fd = vficon_thumb_next_fd(vf); break;
	}

	if (!fd)
		{
		/* done */
		vf_thumb_cleanup(vf);
		return FALSE;
		}

	vf->thumbs_filedata = fd;

	thumb_loader_free(vf->thumbs_loader);

	vf->thumbs_loader = thumb_loader_new(options->thumbnails.max_width, options->thumbnails.max_height);
	thumb_loader_set_callbacks(vf->thumbs_loader,
				   vf_thumb_done_cb,
				   vf_thumb_error_cb,
				   NULL,
				   vf);

	if (!thumb_loader_start(vf->thumbs_loader, fd))
		{
		/* set icon to unknown, continue */
		DEBUG_1("thumb loader start failed %s", fd->path);
		vf_thumb_do(vf, fd);

		return TRUE;
		}

	return FALSE;
}
开发者ID:GroupO,项目名称:geeqie_zas,代码行数:49,代码来源:view_file.c


示例17: gtk_anim_label_set_text

void gtk_anim_label_set_text(GtkAnimLabel * anim_label, const gchar * txt
)
{
	g_return_if_fail(anim_label != NULL);
	g_return_if_fail(GTK_IS_ANIM_LABEL(anim_label));


	if (anim_label->txt)
	{
		g_free(anim_label->txt);
		anim_label->txt = NULL;
	}

	if ((txt == NULL) || (strlen(txt) <= 0))
		return;

	if (txt != NULL)
		anim_label->txt = g_strdup(txt);

	if (anim_label->auto_reset)
		anim_label->pos_x = 0;

	if ((!anim_label->timer) && (anim_label->delay_sec > 0))
		anim_label->timer = g_timer_new();
	else if (anim_label->delay_sec > 0)
		g_timer_start(anim_label->timer);


	if (anim_label->layout)
	{
		g_object_unref(G_OBJECT(anim_label->layout));
		anim_label->layout = NULL;
	}

	if (anim_label->pixmap)
	{
		g_object_unref(G_OBJECT(anim_label->pixmap));
		anim_label->pixmap = NULL;
	}

	anim_label_create_layout(anim_label, (anim_label->txt) ? anim_label->txt : "");

	if (!anim_label->pixmap && GTK_WIDGET_REALIZED(GTK_WIDGET(anim_label)))
	{
		anim_label_create_pixmap(anim_label);
	}

	gtk_widget_queue_resize(GTK_WIDGET(anim_label));
}
开发者ID:krzyzanowskim,项目名称:GNUGadu,代码行数:49,代码来源:gtkanimlabel.c


示例18: gimp_window_get_native

/**
 * gimp_window_get_native:
 * @window: a #GtkWindow
 *
 * This function is used to pass a window handle to plug-ins so that
 * they can set their dialog windows transient to the parent window.
 *
 * Return value: a native window handle of the window's #GdkWindow or 0
 *               if the window isn't realized yet
 */
GdkNativeWindow
gimp_window_get_native (GtkWindow *window)
{
  g_return_val_if_fail (GTK_IS_WINDOW (window), 0);

#ifdef GDK_NATIVE_WINDOW_POINTER
#ifdef __GNUC__
#warning gimp_window_get_native() unimplementable for the target windowing system
#endif
  return (GdkNativeWindow)0;
#endif

#ifdef GDK_WINDOWING_WIN32
  if (window && GTK_WIDGET_REALIZED (window))
    return (GdkNativeWindow)GDK_WINDOW_HWND (GTK_WIDGET (window)->window);
#endif

#ifdef GDK_WINDOWING_X11
  if (window && GTK_WIDGET_REALIZED (window))
    return GDK_WINDOW_XID (GTK_WIDGET (window)->window);
#endif

  return (GdkNativeWindow)0;
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:34,代码来源:gimpwidgets-utils.c


示例19: selectcolor_size_allocate

static void selectcolor_size_allocate(GtkWidget* widget,
                                      GtkAllocation* allocation)
{
	g_return_if_fail(widget != NULL);
	g_return_if_fail(IS_SELECT_COLOR(widget));
	g_return_if_fail(allocation != NULL);

	widget->allocation = *allocation;

	if (GTK_WIDGET_REALIZED(widget))
	{
		gdk_window_move_resize(widget->window, allocation->x, allocation->y,
		                       allocation->width, allocation->height);
	}
}
开发者ID:cass00,项目名称:xournalpp,代码行数:15,代码来源:SelectColor.cpp


示例20: gtk_cpu_size_allocate

static void
gtk_cpu_size_allocate(GtkWidget * widget, GtkAllocation * allocation)
{
	g_return_if_fail(widget != NULL);
	g_return_if_fail(GTK_IS_CPU(widget));
	g_return_if_fail(allocation != NULL);

	widget->allocation = *allocation;

	if (GTK_WIDGET_REALIZED(widget)) {
		gdk_window_move_resize(widget->window,
				       allocation->x, allocation->y,
				       allocation->width, allocation->height);
	}
}
开发者ID:zhoujianchun,项目名称:gtk-pro,代码行数:15,代码来源:cpu.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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