當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。