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


C++ GTK_STACK函数代码示例

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


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

示例1: gui_update

void gui_update(dt_iop_module_t *self)
{
  dt_iop_levels_gui_data_t *g = (dt_iop_levels_gui_data_t *)self->gui_data;
  dt_iop_levels_params_t *p = (dt_iop_levels_params_t *)self->params;

  dt_bauhaus_combobox_set(g->mode, g_list_index(g->modes, GUINT_TO_POINTER(p->mode)));
  dt_bauhaus_slider_set(g->percentile_black, p->percentiles[0]);
  dt_bauhaus_slider_set(g->percentile_grey, p->percentiles[1]);
  dt_bauhaus_slider_set(g->percentile_white, p->percentiles[2]);

  switch(p->mode)
  {
    case LEVELS_MODE_AUTOMATIC:
      gtk_stack_set_visible_child_name(GTK_STACK(g->mode_stack), "automatic");
      break;
    case LEVELS_MODE_MANUAL:
    default:
      gtk_stack_set_visible_child_name(GTK_STACK(g->mode_stack), "manual");
      break;
  }

  dt_pthread_mutex_lock(&g->lock);
  g->auto_levels[0] = NAN;
  g->auto_levels[1] = NAN;
  g->auto_levels[2] = NAN;
  dt_pthread_mutex_unlock(&g->lock);

  gtk_widget_queue_draw(self->widget);
}
开发者ID:AdamMajer,项目名称:darktable,代码行数:29,代码来源:levels.c

示例2: dt_iop_levels_mode_callback

static void dt_iop_levels_mode_callback(GtkWidget *combo, gpointer user_data)
{
  dt_iop_module_t *self = (dt_iop_module_t *)user_data;

  if(darktable.gui->reset) return;

  dt_iop_levels_gui_data_t *g = (dt_iop_levels_gui_data_t *)self->gui_data;
  dt_iop_levels_params_t *p = (dt_iop_levels_params_t *)self->params;

  const dt_iop_levels_mode_t new_mode
      = GPOINTER_TO_UINT(g_list_nth_data(g->modes, dt_bauhaus_combobox_get(combo)));

  switch(new_mode)
  {
    case LEVELS_MODE_AUTOMATIC:
      p->mode = LEVELS_MODE_AUTOMATIC;
      gtk_stack_set_visible_child_name(GTK_STACK(g->mode_stack), "automatic");
      break;
    case LEVELS_MODE_MANUAL:
    default:
      p->mode = LEVELS_MODE_MANUAL;
      gtk_stack_set_visible_child_name(GTK_STACK(g->mode_stack), "manual");
      break;
  }

  dt_dev_add_history_item(darktable.develop, self, TRUE);
}
开发者ID:AdamMajer,项目名称:darktable,代码行数:27,代码来源:levels.c

示例3: gt_games_view_show_type

void
gt_games_view_show_type(GtGamesView* self, gint type)
{
    GtGamesViewPrivate* priv = gt_games_view_get_instance_private(self);

    switch (type)
    {
        case GT_GAMES_CONTAINER_TYPE_TOP:
            gtk_stack_set_visible_child(GTK_STACK(priv->games_stack), priv->top_container);
            priv->was_showing_game = FALSE;
            break;
        case GT_GAMES_CONTAINER_TYPE_SEARCH:
            gtk_stack_set_visible_child(GTK_STACK(priv->games_stack), priv->search_container);
            break;
        case GT_CHANNELS_CONTAINER_TYPE_GAME:
            gtk_stack_set_visible_child(GTK_STACK(priv->games_stack), priv->game_container);
            priv->was_showing_game = TRUE;
            break;
        default:
            break;
    }

    g_object_notify_by_pspec(G_OBJECT(self), props[PROP_SHOWING_TOP_GAMES]);
    g_object_notify_by_pspec(G_OBJECT(self), props[PROP_SHOWING_GAME_CHANNELS]);
}
开发者ID:ElJava,项目名称:gnome-twitch,代码行数:25,代码来源:gt-games-view.c

示例4: main_window

static GtkWidget* main_window() {
  GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title(GTK_WINDOW(window), "Switcher");
  gtk_container_set_border_width(GTK_CONTAINER(window), 10);

  GtkWidget* box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
  gtk_container_add(GTK_CONTAINER(window), box);

  // Stack
  GtkWidget* main_area = gtk_stack_new();
  gtk_stack_set_transition_type(GTK_STACK(main_area),
                                GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT);
  gtk_stack_set_transition_duration(GTK_STACK(main_area), 2000);

  // Checkbox
  GtkWidget* check_button =
      gtk_check_button_new_with_label("Do not fn check me");
  gtk_stack_add_titled(GTK_STACK(main_area), check_button, "check_name",
                       "Check Box");

  // Label
  GtkWidget* label = gtk_label_new(NULL);
  gtk_label_set_markup(GTK_LABEL(label), "<big>OMG this text is huge!</big>");
  gtk_stack_add_titled(GTK_STACK(main_area), label, "label_name", "Big Label");

  // StackSwitcher
  GtkWidget* stack_switcher = gtk_stack_switcher_new();
  gtk_stack_switcher_set_stack(GTK_STACK_SWITCHER(stack_switcher),
                               GTK_STACK(main_area));

  gtk_box_pack_start(GTK_BOX(box), stack_switcher, TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(box), main_area, TRUE, TRUE, 0);

  return window;
}
开发者ID:pope,项目名称:gtk3_examples,代码行数:35,代码来源:07_stack.c

示例5: ephy_title_box_constructed

static void
ephy_title_box_constructed (GObject *object)
{
  EphyTitleBox        *title_box = EPHY_TITLE_BOX (object);
  EphyWindowChrome chrome;

  LOG ("EphyTitleBox constructed");

  G_OBJECT_CLASS (ephy_title_box_parent_class)->constructed (object);

  gtk_widget_add_events (GTK_WIDGET (title_box),
                         GDK_BUTTON_PRESS_MASK |
                         GDK_POINTER_MOTION_MASK |
                         GDK_BUTTON_RELEASE_MASK);

  ephy_title_box_add_address_bar (title_box);
  ephy_title_box_add_title_bar (title_box);

  chrome = ephy_window_get_chrome (title_box->window);
  title_box->location_disabled = !(chrome & EPHY_WINDOW_CHROME_LOCATION);
  if (title_box->location_disabled) {
    title_box->mode = EPHY_TITLE_BOX_MODE_TITLE;
    gtk_stack_set_visible_child_name (GTK_STACK (title_box), "title-bar");
  } else {
    title_box->mode = EPHY_TITLE_BOX_MODE_LOCATION_ENTRY;
    gtk_stack_set_visible_child_name (GTK_STACK (title_box), "address-bar");
  }

  g_signal_connect_swapped (title_box->window, "notify::chrome",
                            G_CALLBACK (sync_chromes_visibility),
                            title_box);
}
开发者ID:mgedmin,项目名称:epiphany,代码行数:32,代码来源:ephy-title-box.c

示例6: gtk_inspector_window_init

static void
gtk_inspector_window_init (GtkInspectorWindow *iw)
{
  GIOExtensionPoint *extension_point;
  GList *l, *extensions;

  gtk_widget_init_template (GTK_WIDGET (iw));

  gtk_window_group_add_window (gtk_window_group_new (), GTK_WINDOW (iw));

  extension_point = g_io_extension_point_lookup ("gtk-inspector-page");
  extensions = g_io_extension_point_get_extensions (extension_point);

  for (l = extensions; l != NULL; l = l->next)
    {
      GIOExtension *extension = l->data;
      GType type;
      GtkWidget *widget;
      const char *name;
      char *title;
      GtkWidget *button;
      gboolean use_picker;

      type = g_io_extension_get_type (extension);

      widget = g_object_new (type, NULL);

      iw->extra_pages = g_list_prepend (iw->extra_pages, widget);

      name = g_io_extension_get_name (extension);
      g_object_get (widget, "title", &title, NULL);

      if (g_object_class_find_property (G_OBJECT_GET_CLASS (widget), "use-picker"))
        g_object_get (widget, "use-picker", &use_picker, NULL);
      else
        use_picker = FALSE;

      if (use_picker)
        {
          button = gtk_button_new_from_icon_name ("find-location-symbolic",
                                                  GTK_ICON_SIZE_MENU);
          gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
          gtk_widget_set_halign (button, GTK_ALIGN_START);
          gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
          g_signal_connect (button, "clicked",
                            G_CALLBACK (gtk_inspector_on_inspect), iw);
        }
      else
        button = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);

      gtk_stack_add_titled (GTK_STACK (iw->top_stack), widget, name, title);
      gtk_stack_add_named (GTK_STACK (iw->button_stack), button, name);
      gtk_widget_show (widget);
      gtk_widget_show (button);

      g_free (title);
    }

}
开发者ID:alexlarsson,项目名称:gtk,代码行数:59,代码来源:window.c

示例7: photos_view_container_count_changed

static void
photos_view_container_count_changed (PhotosViewContainer *self, gint count)
{
  if (count == 0)
    gtk_stack_set_visible_child_name (GTK_STACK (self), "no-results");
  else
    gtk_stack_set_visible_child_name (GTK_STACK (self), "view");
}
开发者ID:iamneha,项目名称:gnome-photos,代码行数:8,代码来源:photos-view-container.c

示例8: gt_win_browse_view

//TODO: Make these actions
void
gt_win_browse_view(GtWin* self)
{
    GtWinPrivate* priv = gt_win_get_instance_private(self);

    gtk_stack_set_visible_child_name(GTK_STACK(priv->header_stack),
                                     "browse");
    gtk_stack_set_visible_child_name(GTK_STACK(priv->main_stack),
                                     "browse");
}
开发者ID:AlejandroC90,项目名称:gnome-twitch,代码行数:11,代码来源:gt-win.c

示例9: settings_clicked

static void
settings_clicked(G_GNUC_UNUSED GtkButton *button, RingMainWindow *win)
{
    g_return_if_fail(IS_RING_MAIN_WINDOW(win));
    RingMainWindowPrivate *priv = RING_MAIN_WINDOW_GET_PRIVATE(win);

    /* check which view to show */
    if (!priv->show_settings) {
        /* show the settings */

        /* make sure we are not showing a call view so we don't have more than one clutter stage at a time */
        selection_changed(QModelIndex(), win);

        /* show settings */
        gtk_image_set_from_icon_name(GTK_IMAGE(priv->image_settings), "emblem-ok-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR);

        gtk_widget_show(priv->hbox_settings);

        /* make sure to start preview if we're showing the video settings */
        if (priv->last_settings_view == priv->media_settings_view)
            media_settings_view_show_preview(MEDIA_SETTINGS_VIEW(priv->media_settings_view), TRUE);

        gtk_stack_set_transition_type(GTK_STACK(priv->stack_main_view), GTK_STACK_TRANSITION_TYPE_SLIDE_UP);
        gtk_stack_set_visible_child(GTK_STACK(priv->stack_main_view), priv->last_settings_view);

        priv->show_settings = TRUE;
    } else {
        /* hide the settings */
        priv->show_settings = FALSE;

        /* show working dialog in case save operation takes time */
        GtkWidget *working = ring_dialog_working(GTK_WIDGET(win), NULL);
        gtk_window_present(GTK_WINDOW(working));

        /* now save after the time it takes to transition back to the call view (400ms)
         * the save doesn't happen before the "working" dialog is presented
         * the timeout function should destroy the "working" dialog when done saving
         */
        g_timeout_add_full(G_PRIORITY_DEFAULT, 400, (GSourceFunc)save_accounts, working, NULL);

        /* show calls */
        gtk_image_set_from_icon_name(GTK_IMAGE(priv->image_settings), "emblem-system-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR);

        gtk_widget_hide(priv->hbox_settings);

        /* make sure video preview is stopped, in case it was started */
        media_settings_view_show_preview(MEDIA_SETTINGS_VIEW(priv->media_settings_view), FALSE);

        gtk_stack_set_transition_type(GTK_STACK(priv->stack_main_view), GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN);
        gtk_stack_set_visible_child_name(GTK_STACK(priv->stack_main_view), CALL_VIEW_NAME);

        /* show the view which was selected previously */
        selection_changed(RecentModel::instance().selectionModel()->currentIndex(), win);
    }
}
开发者ID:eXcomm,项目名称:ring-client-gnome,代码行数:55,代码来源:ringmainwindow.cpp

示例10: gui_update

void gui_update(struct dt_iop_module_t *self)
{
  dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data;
  dt_iop_exposure_params_t *p = (dt_iop_exposure_params_t *)self->params;

  if(!dt_image_is_raw(&self->dev->image_storage))
  {
    gtk_widget_hide(GTK_WIDGET(g->mode));
    p->mode = EXPOSURE_MODE_MANUAL;
    dt_dev_add_history_item(darktable.develop, self, TRUE);
  }
  else
  {
    gtk_widget_show(GTK_WIDGET(g->mode));
  }

  dt_bauhaus_combobox_set(g->mode, g_list_index(g->modes, GUINT_TO_POINTER(p->mode)));

  dt_bauhaus_slider_set_soft(g->black, p->black);
  dt_bauhaus_slider_set_soft(g->exposure, p->exposure);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->autoexp), FALSE);
  dt_bauhaus_slider_set(g->autoexpp, 0.01);
  gtk_widget_set_sensitive(GTK_WIDGET(g->autoexpp), FALSE);

  dt_bauhaus_slider_set(g->deflicker_percentile, p->deflicker_percentile);
  dt_bauhaus_slider_set(g->deflicker_target_level, p->deflicker_target_level);
  dt_bauhaus_combobox_set(
      g->deflicker_histogram_source,
      g_list_index(g->deflicker_histogram_sources, GUINT_TO_POINTER(p->deflicker_histogram_source)));

  self->request_color_pick = DT_REQUEST_COLORPICK_OFF;

  free(g->deflicker_histogram);
  g->deflicker_histogram = NULL;

  gtk_label_set_text(g->deflicker_used_EC, "");
  dt_pthread_mutex_lock(&g->lock);
  g->deflicker_computed_exposure = NAN;
  dt_pthread_mutex_unlock(&g->lock);

  switch(p->mode)
  {
    case EXPOSURE_MODE_DEFLICKER:
      autoexp_disable(self);
      gtk_stack_set_visible_child_name(GTK_STACK(g->mode_stack), "deflicker");
      if(p->deflicker_histogram_source == DEFLICKER_HISTOGRAM_SOURCE_SOURCEFILE)
        deflicker_prepare_histogram(self, &g->deflicker_histogram, &g->deflicker_histogram_stats);
      break;
    case EXPOSURE_MODE_MANUAL:
    default:
      gtk_stack_set_visible_child_name(GTK_STACK(g->mode_stack), "manual");
      break;
  }
}
开发者ID:Acidburn0zzz,项目名称:darktable,代码行数:55,代码来源:exposure.c

示例11: as_screenshot_show_image

/**
 * as_screenshot_show_image:
 **/
static void
as_screenshot_show_image (GsScreenshotImage *ssimg)
{
	GsScreenshotImagePrivate *priv;
	_cleanup_object_unref_ GdkPixbuf *pixbuf_bg = NULL;
	_cleanup_object_unref_ GdkPixbuf *pixbuf = NULL;

	priv = gs_screenshot_image_get_instance_private (ssimg);

	/* no need to composite */
	if (priv->width == G_MAXUINT || priv->height == G_MAXUINT) {
		pixbuf_bg = gdk_pixbuf_new_from_file (priv->filename, NULL);
	} else {
		/* this is always going to have alpha */
		pixbuf = gdk_pixbuf_new_from_file_at_scale (priv->filename,
							    priv->width * priv->scale,
							    priv->height * priv->scale,
							    FALSE, NULL);
		if (pixbuf != NULL) {
			if (gs_screenshot_image_use_desktop_background (ssimg, pixbuf)) {
				pixbuf_bg = gs_screenshot_image_get_desktop_pixbuf (ssimg);
				if (pixbuf_bg == NULL) {
					pixbuf_bg = g_object_ref (pixbuf);
				} else {
					gdk_pixbuf_composite (pixbuf, pixbuf_bg,
							      0, 0,
							      priv->width, priv->height,
							      0, 0, 1.0f, 1.0f,
							      GDK_INTERP_NEAREST, 255);
				}
			} else {
				pixbuf_bg = g_object_ref (pixbuf);
			}
		}
	}

	/* show icon */
	if (g_strcmp0 (priv->current_image, "image1") == 0) {
		if (pixbuf_bg != NULL) {
			gs_image_set_from_pixbuf_with_scale (GTK_IMAGE (priv->image2),
							     pixbuf_bg, priv->scale);
		}
		gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "image2");
		priv->current_image = "image2";
	} else {
		if (pixbuf_bg != NULL) {
			gs_image_set_from_pixbuf_with_scale (GTK_IMAGE (priv->image1),
							     pixbuf_bg, priv->scale);
		}
		gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "image1");
		priv->current_image = "image1";
	}

	gtk_widget_show (GTK_WIDGET (ssimg));
}
开发者ID:ppigmans,项目名称:gnome-software,代码行数:58,代码来源:gs-screenshot-image.c

示例12: gs_shell_overview_refreshed

static void
gs_shell_overview_refreshed (GsShellOverview *self)
{
	GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);

	if (priv->empty) {
		gtk_stack_set_visible_child_name (GTK_STACK (priv->stack_overview), "no-results");
	} else {
		gtk_stack_set_visible_child_name (GTK_STACK (priv->stack_overview), "overview");
	}
}
开发者ID:JamesLinus,项目名称:gnome-software,代码行数:11,代码来源:gs-shell-overview.c

示例13: clickity

static void
clickity (GtkButton *button,
          gpointer   stack)
{
  if (g_strcmp0 (gtk_stack_get_visible_child_name (GTK_STACK (stack)), "label") == 0)
    gtk_stack_set_visible_child_name (GTK_STACK (stack), "clutter");
  else
    gtk_stack_set_visible_child_name (GTK_STACK (stack), "label");

  fade = !fade;
}
开发者ID:GNOME,项目名称:clutter-gtk,代码行数:11,代码来源:gtk-clutter-test.c

示例14: show_general_settings

static void
show_general_settings(GtkToggleButton *navbutton, RingMainWindow *win)
{
    g_return_if_fail(IS_RING_MAIN_WINDOW(win));
    RingMainWindowPrivate *priv = RING_MAIN_WINDOW_GET_PRIVATE(win);

    if (gtk_toggle_button_get_active(navbutton)) {
        gtk_stack_set_transition_type(GTK_STACK(priv->stack_main_view), GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT);
        gtk_stack_set_visible_child_name(GTK_STACK(priv->stack_main_view), GENERAL_SETTINGS_VIEW_NAME);
        priv->last_settings_view = priv->general_settings_view;
    }
}
开发者ID:eXcomm,项目名称:ring-client-gnome,代码行数:12,代码来源:ringmainwindow.cpp

示例15: gt_win_open_channel

//TODO: Make this action
void
gt_win_open_channel(GtWin* self, GtChannel* chan)
{
    GtWinPrivate* priv = gt_win_get_instance_private(self);

    gt_player_open_channel(GT_PLAYER(self->player), chan);

    gtk_stack_set_visible_child_name(GTK_STACK(priv->main_stack),
                                     "player");
    gtk_stack_set_visible_child_name(GTK_STACK(priv->header_stack),
                                     "player");
}
开发者ID:AlejandroC90,项目名称:gnome-twitch,代码行数:13,代码来源:gt-win.c


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