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


C++ GTK_IS_WIDGET函数代码示例

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


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

示例1: gimp_dialog_factory_hide_dialog

void
gimp_dialog_factory_hide_dialog (GtkWidget *dialog)
{
  g_return_if_fail (GTK_IS_WIDGET (dialog));
  g_return_if_fail (GTK_WIDGET_TOPLEVEL (dialog));

  if (! gimp_dialog_factory_from_widget (dialog, NULL))
    {
      g_warning ("%s: dialog was not created by a GimpDialogFactory",
                 G_STRFUNC);
      return;
    }

  gtk_widget_hide (dialog);

  if (! dialogs_shown)
    g_object_set_data (G_OBJECT (dialog), GIMP_DIALOG_VISIBILITY_KEY,
                       GINT_TO_POINTER (GIMP_DIALOG_VISIBILITY_INVISIBLE));
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:19,代码来源:gimpdialogfactory.c

示例2: gb_widget_activate_action

gboolean
gb_widget_activate_action (GtkWidget   *widget,
                           const gchar *prefix,
                           const gchar *action_name,
                           GVariant    *parameter)
{
    GApplication *app;
    GtkWidget *toplevel;
    GActionGroup *group = NULL;

    g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
    g_return_val_if_fail (prefix, FALSE);
    g_return_val_if_fail (action_name, FALSE);

    app = g_application_get_default ();
    toplevel = gtk_widget_get_toplevel (widget);

    while ((group == NULL) && (widget != NULL))
    {
        group = gtk_widget_get_action_group (widget, prefix);
        widget = gtk_widget_get_parent (widget);
    }

    if (!group && g_str_equal (prefix, "win") && G_IS_ACTION_GROUP (toplevel))
        group = G_ACTION_GROUP (toplevel);

    if (!group && g_str_equal (prefix, "app") && G_IS_ACTION_GROUP (app))
        group = G_ACTION_GROUP (app);

    if (group && g_action_group_has_action (group, action_name))
    {
        g_action_group_activate_action (group, action_name, parameter);
        return TRUE;
    }

    if (parameter && g_variant_is_floating (parameter))
    {
        parameter = g_variant_ref_sink (parameter);
        g_variant_unref (parameter);
    }

    return FALSE;
}
开发者ID:riadnassiffe,项目名称:gnome-builder,代码行数:43,代码来源:gb-widget.c

示例3: gb_vim_command_cprevious

static gboolean
gb_vim_command_cprevious (GtkWidget      *active_widget,
                          const gchar    *command,
                          const gchar    *options,
                          GError        **error)
{
  g_assert (GTK_IS_WIDGET (active_widget));

  if (IDE_IS_EDITOR_PAGE (active_widget))
    {
      IdeSourceView *source_view = ide_editor_page_get_view (IDE_EDITOR_PAGE (active_widget));

      g_signal_emit_by_name (source_view, "move-error", GTK_DIR_UP);

      return TRUE;
    }
  else
    return gb_vim_set_source_view_error (error);
}
开发者ID:GNOME,项目名称:gnome-builder,代码行数:19,代码来源:gb-vim.c

示例4: lyric_show_viewport_update_current_widget

static void
lyric_show_viewport_update_current_widget(LyricShowViewport *lsv)
{
    if((!lsv->priv->is_pressed) && lsv->priv->current_widget)
    {
        GtkAllocation alc0,alc1;
        const gchar *color_string = "blue";

#if GTK_CHECK_VERSION(3,2,0)
        GdkRGBA color = {0};
        gdk_rgba_parse(&color,color_string);
#else
        GdkColor color = {0};
        gdk_color_parse(color_string,&color);
#endif

        if(lsv->priv->pre_widget &&
            GTK_IS_WIDGET(lsv->priv->pre_widget) &&
            lsv->priv->current_widget !=lsv->priv->pre_widget)
        {
#if GTK_CHECK_VERSION(3,2,0)
            gtk_widget_override_color(lsv->priv->pre_widget,GTK_STATE_FLAG_ACTIVE,NULL);
            gtk_widget_set_state_flags(lsv->priv->pre_widget,GTK_STATE_FLAG_ACTIVE,FALSE);
#else
            gtk_widget_modify_fg(lsv->priv->pre_widget,GTK_STATE_ACTIVE,NULL);
            gtk_widget_set_state(lsv->priv->pre_widget,GTK_STATE_NORMAL);
#endif
        }

#if GTK_CHECK_VERSION(3,2,0)
        gtk_widget_override_color(lsv->priv->current_widget,GTK_STATE_FLAG_ACTIVE,&color);
        gtk_widget_set_state_flags(lsv->priv->current_widget,GTK_STATE_FLAG_ACTIVE,FALSE);
#else
        gtk_widget_modify_fg(lsv->priv->current_widget,GTK_STATE_ACTIVE,&color);
        gtk_widget_set_state(lsv->priv->current_widget,GTK_STATE_ACTIVE);
#endif

        gtk_widget_get_allocation(lsv->priv->current_widget,&alc0);
        gtk_widget_get_allocation(lsv->priv->lyricbox,&alc1);
        lsv->priv->pos = (alc0.y - alc1.y)+alc0.height/2.0;
        gtk_widget_queue_resize(GTK_WIDGET(lsv));
    }
}
开发者ID:wkt,项目名称:liblyric,代码行数:43,代码来源:lyricshowviewport.c

示例5: gtk_expander_set_label_widget

/**
 * gtk_expander_set_label_widget:
 * @expander: a #GtkExpander
 * @label_widget: (allow-none): the new label widget
 *
 * Set the label widget for the expander. This is the widget
 * that will appear embedded alongside the expander arrow.
 *
 * Since: 2.4
 **/
void
gtk_expander_set_label_widget (GtkExpander *expander,
			       GtkWidget   *label_widget)
{
  GtkExpanderPrivate *priv;
  GtkWidget          *widget;

  g_return_if_fail (GTK_IS_EXPANDER (expander));
  g_return_if_fail (label_widget == NULL || GTK_IS_WIDGET (label_widget));
  g_return_if_fail (label_widget == NULL || label_widget->parent == NULL);

  priv = expander->priv;

  if (priv->label_widget == label_widget)
    return;

  if (priv->label_widget)
    {
      gtk_widget_set_state (priv->label_widget, GTK_STATE_NORMAL);
      gtk_widget_unparent (priv->label_widget);
    }

  priv->label_widget = label_widget;
  widget = GTK_WIDGET (expander);

  if (label_widget)
    {
      priv->label_widget = label_widget;

      gtk_widget_set_parent (label_widget, widget);

      if (priv->prelight)
	gtk_widget_set_state (label_widget, GTK_STATE_PRELIGHT);
    }

  if (gtk_widget_get_visible (widget))
    gtk_widget_queue_resize (widget);

  g_object_freeze_notify (G_OBJECT (expander));
  g_object_notify (G_OBJECT (expander), "label-widget");
  g_object_notify (G_OBJECT (expander), "label");
  g_object_thaw_notify (G_OBJECT (expander));
}
开发者ID:Krlos0208,项目名称:Sintetizador_Voz,代码行数:53,代码来源:gtkexpander.c

示例6: checkbutton_handler

G_MODULE_EXPORT gboolean checkbutton_handler(GtkWidget *widget, gpointer data)
{
	gboolean state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
	gint handler = (GINT)OBJ_GET((widget),"handler");
	MtxGaugeFace *g = NULL;

	if (GTK_IS_WIDGET(gauge))
		g = MTX_GAUGE_FACE(gauge);
	else 
		return FALSE;

	if (hold_handlers)
		return TRUE;

	changed = TRUE;
	mtx_gauge_face_set_attribute(g,handler, state);

	return TRUE;
}
开发者ID:toxicgumbo,项目名称:MegaTunix,代码行数:19,代码来源:handlers.c

示例7: on_file_view_show_popup_menu

static void
on_file_view_show_popup_menu (AnjutaFileView* view, GFile* file,
							  gboolean is_dir, guint button,
							  guint32 time, AnjutaFileManager* file_manager)
{
	GtkWidget *popup;
	GtkWidget *rename;
	AnjutaUI* ui = anjuta_shell_get_ui (ANJUTA_PLUGIN(file_manager)->shell, 
										NULL);
	popup = gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui),
									   "/PopupFileManager");
	rename = gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui),
									   "/PopupFileManager/PopupFileManagerRename");
	/* TODO */
	gtk_widget_hide (rename);
	
	g_return_if_fail (GTK_IS_WIDGET (popup));
	gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL, button, time);
}
开发者ID:kyoushuu,项目名称:anjuta,代码行数:19,代码来源:plugin.c

示例8: refresh_window_cb

static void refresh_window_cb (G_GNUC_UNUSED GtkWidget *widget, gpointer data)
{
    DEBUG_FUNCTION ("refresh_window_cb");
    DEBUG_ASSERT (data != NULL);

    GdkRectangle rect;
    if (GTK_IS_WIDGET(data))
    {
        if (gtk_widget_get_window (GTK_WIDGET (data)))
        {
            rect.x = rect.y = 0;
            GtkAllocation allocation;
            gtk_widget_get_allocation (GTK_WIDGET (data), &allocation);
            rect.width = allocation.width;
            rect.height = allocation.height;
            gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET(data)), &rect, TRUE);
        }
    }
}
开发者ID:Kalabasa,项目名称:tilda,代码行数:19,代码来源:tilda_terminal.c

示例9: gtk_icon_helper_new_named

GtkCssGadget *
gtk_icon_helper_new_named (const char *name,
                           GtkWidget  *owner)
{
  GtkIconHelper *result;
  GtkCssNode *node;

  g_return_val_if_fail (name != NULL, NULL);
  g_return_val_if_fail (GTK_IS_WIDGET (owner), NULL);

  node = gtk_css_node_new ();
  gtk_css_node_set_name (node, g_intern_string (name));

  result = gtk_icon_helper_new (node, owner);

  g_object_unref (node);

  return GTK_CSS_GADGET (result);
}
开发者ID:Premangshu2010,项目名称:gtk,代码行数:19,代码来源:gtkiconhelper.c

示例10: gtk_text_child_anchor_unregister_child

void
gtk_text_child_anchor_unregister_child (GtkTextChildAnchor *anchor,
                                        GtkWidget          *child)
{
  g_return_if_fail (GTK_IS_TEXT_CHILD_ANCHOR (anchor));
  g_return_if_fail (GTK_IS_WIDGET (child));

  CHECK_IN_BUFFER (anchor);
  
  if (_gtk_anchored_child_get_layout (child))
    {
      gtk_text_child_anchor_queue_resize (anchor,
                                          _gtk_anchored_child_get_layout (child));
    }
  
  _gtk_anchored_child_set_layout (child, NULL);
  
  _gtk_widget_segment_remove (anchor->segment, child);
}
开发者ID:3v1n0,项目名称:gtk,代码行数:19,代码来源:gtktextchild.c

示例11: ppg_util_load_ui

void
ppg_util_load_ui (GtkWidget       *widget,
                  GtkActionGroup **actions,
                  const gchar     *ui_data,
                  const gchar     *first_widget,
                  ...)
{
	GtkUIManager *ui_manager;
	GtkActionGroup *action_group;
	GtkAccelGroup *accel_group;
	const gchar *name;
	GtkWidget **dst_widget;
	GError *error = NULL;
	GType type;
	va_list args;

	g_return_if_fail(GTK_IS_WIDGET(widget));
	g_return_if_fail(ui_data != NULL);
	g_return_if_fail(first_widget != NULL);

	ui_manager = gtk_ui_manager_new();
	if (!gtk_ui_manager_add_ui_from_string(ui_manager, ui_data, -1, &error)) {
		g_error("%s", error->message); /* Fatal */
	}

	type = G_TYPE_FROM_INSTANCE(widget);
	accel_group = gtk_ui_manager_get_accel_group(ui_manager);
	action_group = gtk_action_group_new(g_type_name(type));
	ppg_actions_load(widget, accel_group, action_group);
	gtk_ui_manager_insert_action_group(ui_manager, action_group, 0);

	name = first_widget;
	va_start(args, first_widget);

	do {
		dst_widget = va_arg(args, GtkWidget**);
		*dst_widget = gtk_ui_manager_get_widget(ui_manager, name);
	} while ((name = va_arg(args, const gchar*)));

	if (actions) {
		*actions = action_group;
	}
}
开发者ID:chergert,项目名称:perfkit,代码行数:43,代码来源:ppg-util.c

示例12: eel_gtk_container_child_remove

/**
 * eel_gtk_container_child_remove:
 *
 * @container: A GtkContainer widget.
 * @child: A non NULL child of @container.
 *
 * Remove @child from @container.  The @container is resized if needed.
 * This is usually called from the "GtkContainer::remove" method of the
 * @container.  The child cannot be NULL.
 */
void
eel_gtk_container_child_remove (GtkContainer *container,
                                GtkWidget *child)
{
    gboolean child_was_visible;

    g_return_if_fail (GTK_IS_CONTAINER (container));
    g_return_if_fail (GTK_IS_WIDGET (child));
    g_return_if_fail (gtk_widget_get_parent (child) == GTK_WIDGET (container));

    child_was_visible = gtk_widget_get_visible (child);

    gtk_widget_unparent (child);

    if (child_was_visible)
    {
        gtk_widget_queue_resize (GTK_WIDGET (container));
    }
}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:29,代码来源:eel-gtk-container.c

示例13: close_current_gauge

EXPORT gboolean close_current_gauge(GtkWidget * widget, gpointer data)
{
	GtkWidget *tmp = NULL;
	GladeXML *xml = glade_get_widget_tree(widget);
	GtkWidget *parent = glade_xml_get_widget(xml,"gauge_frame");

	if (GTK_IS_WIDGET(gauge))
	{
		if (changed)
			prompt_to_save();
		gtk_widget_destroy(gauge);
		gtk_widget_set_sensitive(glade_xml_get_widget(xml,"tab_notebook"),FALSE);
		gauge_loaded = FALSE;
		changed = FALSE;
	}
	gauge = NULL;

	tmp = glade_xml_get_widget(xml,"animate_frame");
	gtk_widget_set_sensitive(tmp,FALSE);

	tmp = glade_xml_get_widget(xml,"new_gauge_menuitem");
	gtk_widget_set_sensitive(tmp,TRUE);

	tmp = glade_xml_get_widget(xml,"load_gauge_menuitem");
	gtk_widget_set_sensitive(tmp,TRUE);

	tmp = glade_xml_get_widget(xml,"close_gauge_menuitem");
	gtk_widget_set_sensitive(tmp,FALSE);

	tmp = glade_xml_get_widget(xml,"save_gauge_menuitem");
	gtk_widget_set_sensitive(tmp,FALSE);

	tmp = glade_xml_get_widget(xml,"save_as_menuitem");
	gtk_widget_set_sensitive(tmp,FALSE);

	tmp = glade_xml_get_widget(xml,"animate_button");
	gtk_widget_set_sensitive(tmp,TRUE);

	reset_onscreen_controls();
	direct_path = FALSE;
	gtk_widget_show_all(parent);
	return (TRUE);
}
开发者ID:Torture,项目名称:MegaTunix,代码行数:43,代码来源:events.c

示例14: on_workbench_set_focus

static void
on_workbench_set_focus (GbCommandProvider *provider,
                        GtkWidget         *widget,
                        GbWorkbench       *workbench)
{
  g_return_if_fail (GB_IS_COMMAND_PROVIDER (provider));
  g_return_if_fail (GB_IS_WORKBENCH (workbench));
  g_return_if_fail (!widget || GTK_IS_WIDGET (widget));

  /* walk the hierarchy to find a tab */
  if (widget)
    while (!GB_IS_VIEW (widget))
      if (!(widget = gtk_widget_get_parent (widget)))
        break;

  if (GB_IS_VIEW (widget))
    gb_command_provider_set_active_view (provider,
                                         GB_VIEW (widget));
}
开发者ID:meghprkh,项目名称:gnome-builder,代码行数:19,代码来源:gb-command-provider.c

示例15: _lib_backgroundjobs_progress

static void _lib_backgroundjobs_progress(dt_lib_module_t *self, const guint *key, double progress)
{
  if(!darktable.control->running) return;
  dt_lib_backgroundjobs_t *d = (dt_lib_backgroundjobs_t*)self->data;
  gboolean i_own_lock = dt_control_gdk_lock();

  dt_bgjob_t *j = (dt_bgjob_t*)g_hash_table_lookup(d->jobs, key);
  if(j)
  {
    /* check if progress is above 1.0 and destroy bgjob if finished */
    /* FIXME: actually we are having some rounding issues, where the */
    /* FIXME: last item doesn't bring to total to 1.0 flat */
    /* FIXME: so this is why we have the ugly kludge below */
    if (progress > 0.999999)
    {
      if (GTK_IS_WIDGET(j->widget))
        gtk_container_remove( GTK_CONTAINER(d->jobbox), j->widget );

#ifdef HAVE_UNITY
      unity_launcher_entry_set_progress( j->darktable_launcher, 1.0 );
      unity_launcher_entry_set_progress_visible( j->darktable_launcher, FALSE );
#endif
#ifdef MAC_INTEGRATION
      gtk_osxapplication_attention_request(g_object_new(GTK_TYPE_OSX_APPLICATION, NULL), INFO_REQUEST);
#endif

      /* hide jobbox if theres no jobs left */
      if (g_list_length(gtk_container_get_children(GTK_CONTAINER(d->jobbox))) == 0 )
        gtk_widget_hide(d->jobbox);
    }
    else
    {
      if( j->type == 0 )
        gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(j->progressbar), progress );

#ifdef HAVE_UNITY
      unity_launcher_entry_set_progress( j->darktable_launcher, progress );
#endif
    }
  }

  if(i_own_lock) dt_control_gdk_unlock();
}
开发者ID:AntonSh,项目名称:darktable,代码行数:43,代码来源:backgroundjobs.c


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