本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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));
}
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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();
}
}
示例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);
}
示例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);
}