当前位置: 首页>>代码示例>>C++>>正文


C++ GTK_WIDGET_STATE函数代码示例

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


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

示例1: drawTest

void drawTest(Ihandle *ih, int posx)
{
  GtkWidget* widget = (GtkWidget*)IupGetAttribute(ih, "WID");
  gdk_draw_arc (widget->window,
                widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
                TRUE,
                0, 0, widget->allocation.width, widget->allocation.height,
                0, 64 * 360);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:9,代码来源:canvas.c

示例2: WinDraw_ShowSplash

void WinDraw_ShowSplash(void)
{

	gdk_draw_pixmap(pixmap,
	    drawarea->style->fg_gc[GTK_WIDGET_STATE(drawarea)],
	    splash_pixmap, 0, 0,
	    768 - keropi_xpm_width, 512 - keropi_xpm_height,
	    keropi_xpm_width, keropi_xpm_height);
}
开发者ID:nonakap,项目名称:xkeropi,代码行数:9,代码来源:windraw.c

示例3: on_window_expose_event

gboolean on_window_expose_event(GtkWidget * da, GdkEventExpose * event, gpointer user_data){
    gdk_draw_drawable(da->window,
        da->style->fg_gc[GTK_WIDGET_STATE(da)], pixmap,
        // Only copy the area that was exposed.
        event->area.x, event->area.y,
        event->area.x, event->area.y,
        event->area.width, event->area.height);
    return TRUE;
}
开发者ID:AlexKordic,项目名称:sandbox,代码行数:9,代码来源:cairoanimate.c

示例4: redraw_viewer

static void redraw_viewer(void)
{
  gdk_draw_pixbuf(drawing_area->window,
                  drawing_area->style->fg_gc[GTK_WIDGET_STATE (drawing_area)],
                  map_buffer, 0, 0, 0, 0,
                  drawing_area->allocation.width,
                  drawing_area->allocation.height,
                  GDK_RGB_DITHER_NONE, 0, 0);
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:9,代码来源:grid_mapping_view.c

示例5: panel_expose_event

static gint
panel_expose_event(GtkWidget *widget, GdkEventExpose *ev)
	{
	gdk_draw_pixmap(widget->window,
			widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
			panel->pixmap, ev->area.x, ev->area.y, ev->area.x, ev->area.y,
			ev->area.width, ev->area.height);
	return FALSE;
	}
开发者ID:cheako,项目名称:gkrellm2-demos,代码行数:9,代码来源:demo3.c

示例6: gpk_redraw

void gpk_redraw(GdkPixmap *pixmap, GtkWidget *pixmapbox)
{
  /* redraw the entire pixmap */
  gdk_draw_pixmap(pixmapbox->window,
		  pixmapbox->style->fg_gc[GTK_WIDGET_STATE (pixmapbox)],
		  pixmap,0,0,0,0,
		  pixmapbox->allocation.width,
		  pixmapbox->allocation.height);
}
开发者ID:Molteris,项目名称:monitord,代码行数:9,代码来源:gpkplotting.c

示例7: subrxFrequencyDisplayExpose

/**
* @brief Callback when subrx is exposed - need to paint it from the pixmap
*
* @param widget
* @param event
*
* @return
*/
gboolean subrxFrequencyDisplayExpose(GtkWidget* widget,GdkEventExpose* event) {
    gdk_draw_drawable(widget->window,
                    widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
                    subrxPixmap,
                    event->area.x, event->area.y,
                    event->area.x, event->area.y,
                    event->area.width, event->area.height);
    return FALSE;
}
开发者ID:joeradtke,项目名称:ghpsdr,代码行数:17,代码来源:subrx.c

示例8: expose_event

static gint
expose_event (GtkWidget *widget, GdkEventExpose *e, C2NetworkTraffic *nt)
{
	gdk_draw_pixmap (widget->window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
					 nt->pixmap, e->area.x, e->area.y, e->area.x, e->area.y,
					 e->area.width, e->area.height);
	
	return FALSE;
}
开发者ID:boskonyc,项目名称:cronosII-scratch,代码行数:9,代码来源:widget-network-traffic.c

示例9: GTK_WIDGET

void ZLGtkApplicationWindow::refresh() {
	ZLApplicationWindow::refresh();

	for (std::map<std::string,GtkMenuItem*>::iterator it = myMenuItems.begin(); it != myMenuItems.end(); it++) {
		const std::string &id = it->first;
		GtkWidget *gtkItem = GTK_WIDGET(it->second);
		if (application().isActionVisible(id)) {
			gtk_widget_show(gtkItem);
		} else {
			gtk_widget_hide(gtkItem);
		}
		bool alreadyEnabled =
			(GTK_WIDGET_STATE(gtkItem) & GTK_STATE_INSENSITIVE) == 0;
		if (application().isActionEnabled(id) != alreadyEnabled) {
			gtk_widget_set_sensitive(gtkItem, !alreadyEnabled);
		}
	}
	for (std::vector<GtkMenuItem*>::reverse_iterator rit = mySubmenuItems.rbegin(); rit != mySubmenuItems.rend(); ++rit) {
		bool isVisible = false;
		bool isEnabled = false;
		GtkMenu *menu = GTK_MENU(gtk_menu_item_get_submenu(*rit));
		GList *children = gtk_container_get_children(GTK_CONTAINER(menu));
		if (children != 0) {
			for (GList *ptr =  g_list_first(children); ptr != 0; ptr = g_list_next(ptr)) {
				GtkMenuItem *item = GTK_MENU_ITEM(ptr->data);
				if (GTK_WIDGET_VISIBLE(item)) {
					isVisible = true;
					isEnabled = (GTK_WIDGET_STATE(item) & GTK_STATE_INSENSITIVE) == 0;
					if (isEnabled) {
						break;
					}
				}
			}
		}
		if (isEnabled != ((GTK_WIDGET_STATE(*rit) & GTK_STATE_INSENSITIVE) == 0)) {
			gtk_widget_set_sensitive(GTK_WIDGET(*rit), isEnabled);
		}
		if (isVisible) {
			gtk_widget_show(GTK_WIDGET(*rit));
		} else {
			gtk_widget_hide(GTK_WIDGET(*rit));
		}
	}
}
开发者ID:euroelessar,项目名称:FBReader,代码行数:44,代码来源:ZLGtkApplicationWindow.cpp

示例10: aurora_get_parent_bg

void
aurora_get_parent_bg (const GtkWidget *widget, AuroraRGB *color)
{
	GtkStateType state_type;
	const GtkWidget *parent;
	GdkColor *gcolor;
	gboolean stop;
	GtkShadowType shadow = GTK_SHADOW_NONE;
	
	if (widget == NULL)
		return;
	
	parent = widget->parent;
	stop = FALSE;
	
	while (parent && !stop)
	{
		stop = FALSE;

		stop |= !GTK_WIDGET_NO_WINDOW (parent);
		stop |= GTK_IS_NOTEBOOK (parent) &&
		        gtk_notebook_get_show_tabs (GTK_NOTEBOOK (parent)) &&
		        gtk_notebook_get_show_border (GTK_NOTEBOOK (parent));

		if (GTK_IS_FRAME(parent))
		{
			shadow = gtk_frame_get_shadow_type(GTK_FRAME(parent));
			stop |= (shadow != GTK_SHADOW_NONE);
		}
		else if (GTK_IS_TOOLBAR (parent))
		{
			gtk_widget_style_get (GTK_WIDGET (parent), "shadow-type", &shadow, NULL);
			
			stop |= (shadow != GTK_SHADOW_NONE);
		}

		if (!stop)
			parent = parent->parent;
	}

	if (parent == NULL)
		return;
	
	state_type = GTK_WIDGET_STATE (parent);
	
	gcolor = &parent->style->bg[state_type];
	
	aurora_gdk_color_to_rgb (gcolor, &color->r, &color->g, &color->b);
    
    if (GTK_IS_FRAME (parent) && shadow != GTK_SHADOW_NONE) {
         if (shadow == (GTK_SHADOW_IN || GTK_SHADOW_ETCHED_IN))
         	aurora_shade (color, color, 0.97);
         else
            aurora_shade (color, color, 1.04);
    }
}
开发者ID:Aurora-and-Equinox,项目名称:Aurora-GTK2,代码行数:56,代码来源:support.c

示例11: expose_event

static gint     expose_event(GtkWidget *widget, GdkEventExpose *event, void *disp)
{
  gdk_draw_pixmap(widget->window,
                  widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
                  pixmap,
                  event->area.x, event->area.y,
                  event->area.x, event->area.y,
                  event->area.width, event->area.height);
  return (FALSE);
}
开发者ID:nicolascormier,项目名称:ncormier-academic-projects,代码行数:10,代码来源:pixmap.c

示例12: gdk_draw_drawable

gboolean Fenetre::expose_event(GtkWidget *widget, GdkEventExpose *event)
{ // devient visible => on réaffiche l'image mémoire à l'écran
  gdk_draw_drawable (widget->window,
		     widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
		     dessin,
		     event->area.x, event->area.y,
		     event->area.x, event->area.y,
		     event->area.width, event->area.height);
  return FALSE;
}
开发者ID:valoufr33380,项目名称:DUT-Info,代码行数:10,代码来源:Fenetre.cpp

示例13: gdk_gc_set_rgb_fg_color

void Fenetre::remplitRectangle(int x,int y,int large,int haut ){ // rectangle plein
    if (existe) {
      gdk_gc_set_rgb_fg_color(fenetre->style->fg_gc[GTK_STATE_NORMAL],&stylo);
      gdk_draw_rectangle (dessin,
    		      fenetre->style->fg_gc[GTK_WIDGET_STATE (fenetre)], TRUE,
    		      x, y, large, haut);
      gtk_widget_queue_draw(fenetre); // provoquer l'affichage
      traiteEvenements();
      }
}
开发者ID:valoufr33380,项目名称:DUT-Info,代码行数:10,代码来源:Fenetre.cpp

示例14: draw_card_box

/* Draw the box around the cards */
static void draw_card_box(int p)
{
	int x, y, w, h;

	get_card_box_pos(p, &x, &y);
	get_card_box_dim(p, &w, &h);
	gdk_draw_rectangle(table_buf,
			   table_style->fg_gc[GTK_WIDGET_STATE(table)],
			   FALSE, x, y, w, h);
}
开发者ID:ralight,项目名称:ggz,代码行数:11,代码来源:table.c

示例15: table_draw_table

void table_draw_table(GdkPixmap * pixmap, int x, int y, int w, int h)
{
	if (pixmap == NULL)
		pixmap = table_drawing_area->window;

	/* Display the buffer */
	gdk_draw_drawable(pixmap,
			  table_style->fg_gc[GTK_WIDGET_STATE(table)],
			  table_buf, x, y, x, y, w, h);
}
开发者ID:ralight,项目名称:ggz,代码行数:10,代码来源:table.c


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