• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GTK_SCALE_BUTTON函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: volume_control_button_update_value

static void volume_control_button_update_value(GtkWidget *widget) {
    LinphoneCall *call = (LinphoneCall *)g_object_get_data(G_OBJECT(widget), "call");
    VolumeControlType type = (VolumeControlType)g_object_get_data(G_OBJECT(widget), "type");

    if(type == VOLUME_CTRL_PLAYBACK) {
        gtk_scale_button_set_value(GTK_SCALE_BUTTON(widget), linphone_call_get_speaker_volume_gain(call));
    } else if(type == VOLUME_CTRL_RECORD) {
        gtk_scale_button_set_value(GTK_SCALE_BUTTON(widget), linphone_call_get_microphone_volume_gain(call));
    }
}
开发者ID:mjpak0109,项目名称:linphone,代码行数:10,代码来源:incall_view.c


示例2: toggle_orientation

static void
toggle_orientation (GtkWidget *button,
                    GtkWidget *scalebutton)
{
  if (gtk_scale_button_get_orientation (GTK_SCALE_BUTTON (scalebutton)) ==
      GTK_ORIENTATION_HORIZONTAL)
    {
      gtk_scale_button_set_orientation (GTK_SCALE_BUTTON (scalebutton),
                                        GTK_ORIENTATION_VERTICAL);
    }
  else
    {
      gtk_scale_button_set_orientation (GTK_SCALE_BUTTON (scalebutton),
                                        GTK_ORIENTATION_HORIZONTAL);
    }
}
开发者ID:batman52,项目名称:dingux-code,代码行数:16,代码来源:testvolumebutton.c


示例3: gtk_scale_button_scroll

static gboolean
gtk_scale_button_scroll (GtkWidget      *widget,
			 GdkEventScroll *event)
{
  GtkScaleButton *button;
  GtkScaleButtonPrivate *priv;
  GtkAdjustment *adj;
  gdouble d;

  button = GTK_SCALE_BUTTON (widget);
  priv = button->priv;
  adj = priv->adjustment;

  if (event->type != GDK_SCROLL)
    return FALSE;

  d = gtk_scale_button_get_value (button);
  if (event->direction == GDK_SCROLL_UP)
    {
      d += adj->step_increment;
      if (d > adj->upper)
	d = adj->upper;
    }
  else
    {
      d -= adj->step_increment;
      if (d < adj->lower)
	d = adj->lower;
    }
  gtk_scale_button_set_value (button, d);

  return TRUE;
}
开发者ID:garnacho,项目名称:gtk-roles-and-siblings,代码行数:33,代码来源:gtkscalebutton.c


示例4: gtk_volume_button_set_property

static void
gtk_volume_button_set_property (GObject       *object,
                                guint          prop_id,
                                const GValue  *value,
                                GParamSpec    *pspec)
{
    GtkScaleButton *button = GTK_SCALE_BUTTON (object);

    switch (prop_id)
    {
    case PROP_SYMBOLIC:
        if (get_symbolic (button) != g_value_get_boolean (value))
        {
            if (g_value_get_boolean (value))
                gtk_scale_button_set_icons (button, (const char **) icons_symbolic);
            else
                gtk_scale_button_set_icons (button, (const char **) icons);
            g_object_notify_by_pspec (object, pspec);
        }
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
        break;
    }
}
开发者ID:Davletvm,项目名称:gtk,代码行数:25,代码来源:gtkvolumebutton.c


示例5: g_source_remove

void FullscreenVideoControllerGtk::hideHud()
{
    if (m_hudTimeoutId) {
        g_source_remove(m_hudTimeoutId);
        m_hudTimeoutId = 0;
    }

    if (!m_hudWindow)
        return;

    // Keep the hud visible if a seek is in progress or if the volume
    // popup is visible.
    GtkWidget* volumePopup = gtk_scale_button_get_popup(GTK_SCALE_BUTTON(m_volumeButton));
    if (m_seekLock || gtk_widget_get_visible(volumePopup)) {
        showHud(true);
        return;
    }

    GdkWindow* window = gtk_widget_get_window(m_window);
    GRefPtr<GdkCursor> cursor = adoptGRef(gdk_cursor_new(GDK_BLANK_CURSOR));
    gdk_window_set_cursor(window, cursor.get());

    gtk_widget_hide(m_hudWindow);

    if (m_progressBarUpdateId) {
        g_source_remove(m_progressBarUpdateId);
        m_progressBarUpdateId = 0;
    }
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:29,代码来源:FullscreenVideoControllerGtk.cpp


示例6: bar_pane_gps_view_state_changed_cb

static void bar_pane_gps_view_state_changed_cb(ChamplainView *view,
           				       GParamSpec *gobject,
           				       gpointer data)
{
	PaneGPSData *pgd = data;
 	ChamplainState status;
 	gint zoom;
	GString *message;

	g_object_get(G_OBJECT(view), "zoom-level", &zoom, NULL);
	message = g_string_new("");
	g_string_printf(message, _("Zoom level %i"), zoom);

	g_object_get(G_OBJECT(view), "state", &status, NULL);
	if (status == CHAMPLAIN_STATE_LOADING)
		{
		gtk_label_set_text(GTK_LABEL(pgd->state), _("Loading map"));
		}
	else
		{
		gtk_label_set_text(GTK_LABEL(pgd->state), message->str);
		}
		
	gtk_widget_set_tooltip_text(GTK_WIDGET(pgd->slider), message->str);
	gtk_scale_button_set_value(GTK_SCALE_BUTTON(pgd->slider), (gdouble)zoom);

	g_string_free(message, TRUE);
}
开发者ID:GroupO,项目名称:geeqie_zas,代码行数:28,代码来源:bar_gps.c


示例7: gtk_scale_button_accessible_notify_gtk

static void
gtk_scale_button_accessible_notify_gtk (GObject    *obj,
                                        GParamSpec *pspec)
{
  GtkScaleButton *scale_button;
  GtkScaleButtonAccessible *accessible;

  scale_button = GTK_SCALE_BUTTON (obj);
  accessible = GTK_SCALE_BUTTON_ACCESSIBLE (gtk_widget_get_accessible (GTK_WIDGET (scale_button)));

  if (strcmp (pspec->name, "adjustment") == 0)
    {
      GtkAdjustment* adjustment;

      adjustment = gtk_scale_button_get_adjustment (scale_button);
      g_signal_connect (adjustment,
                        "value-changed",
                        G_CALLBACK (gtk_scale_button_accessible_value_changed),
                        accessible);
    }
  else
    {
      GTK_WIDGET_ACCESSIBLE_CLASS (gtk_scale_button_accessible_parent_class)->notify_gtk (obj, pspec);
    }
}
开发者ID:3dfxmadscientist,项目名称:gnome-apps,代码行数:25,代码来源:gtkscalebuttonaccessible.c


示例8: cb_button_press

static gboolean
cb_button_press (GtkWidget      *widget,
		 GdkEventButton *event,
		 gpointer        user_data)
{
  GtkScaleButton *button;
  GtkScaleButtonPrivate *priv;
  GtkAdjustment *adj;

  button = GTK_SCALE_BUTTON (user_data);
  priv = button->priv;
  adj = priv->adjustment;

  if (priv->click_id != 0)
    g_source_remove (priv->click_id);

  if (widget == button->plus_button)
    priv->direction = fabs (adj->page_increment);
  else
    priv->direction = - fabs (adj->page_increment);

  priv->click_id = gdk_threads_add_timeout (priv->click_timeout,
                                            cb_button_timeout,
                                            button);
  cb_button_timeout (button);

  return TRUE;
}
开发者ID:garnacho,项目名称:gtk-roles-and-siblings,代码行数:28,代码来源:gtkscalebutton.c


示例9: gtk_scale_button_constructor

static GObject *
gtk_scale_button_constructor (GType                  type,
                              guint                  n_construct_properties,
                              GObjectConstructParam *construct_params)
{
  GObject *object;
  GtkScaleButton *button;
  GtkWidget *frame, *box;
  GtkScaleButtonPrivate *priv;

  object = G_OBJECT_CLASS (gtk_scale_button_parent_class)->constructor (type, n_construct_properties, construct_params);

  button = GTK_SCALE_BUTTON (object);

  priv = button->priv;

  /* frame */
  frame = gtk_frame_new (NULL);
  gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
  gtk_container_add (GTK_CONTAINER (priv->dock), frame);

  /* box with scale and +/- buttons */
  box = gtk_scale_button_scale_box_new (button);
  gtk_container_add (GTK_CONTAINER (frame), box);

  /* set button text and size */
  priv->size = GTK_ICON_SIZE_SMALL_TOOLBAR;
  gtk_scale_button_update_icon (button);

  return object;
}
开发者ID:garnacho,项目名称:gtk-roles-and-siblings,代码行数:31,代码来源:gtkscalebutton.c


示例10: gtk_scale_button_get_property

static void
gtk_scale_button_get_property (GObject     *object,
			       guint        prop_id,
			       GValue      *value,
			       GParamSpec  *pspec)
{
  GtkScaleButton *button = GTK_SCALE_BUTTON (object);
  GtkScaleButtonPrivate *priv = button->priv;

  switch (prop_id)
    {
    case PROP_ORIENTATION:
      g_value_set_enum (value, priv->orientation);
      break;
    case PROP_VALUE:
      g_value_set_double (value, gtk_scale_button_get_value (button));
      break;
    case PROP_SIZE:
      g_value_set_enum (value, priv->size);
      break;
    case PROP_ADJUSTMENT:
      g_value_set_object (value, gtk_scale_button_get_adjustment (button));
      break;
    case PROP_ICONS:
      g_value_set_boxed (value, priv->icon_list);
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
    }
}
开发者ID:garnacho,项目名称:gtk-roles-and-siblings,代码行数:31,代码来源:gtkscalebutton.c


示例11: garu_headerbar_init_playback_buttons

static void
garu_headerbar_init_playback_buttons (GaruHeaderbar *self)
{
  GSettings       *settings;
  GaruApplication *app;
  GtkWidget       *box, *button, *image;

  app = GARU_APPLICATION (g_application_get_default ());
  settings = garu_application_get_settings (app);

  box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);

  /* shuffle */
  button = garu_utils_new_icon_button ("media-playlist-shuffle-symbolic",
				       TRUE, FALSE);
  gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
  gtk_widget_show (button);
  /* repeat */
  button = garu_utils_new_icon_button ("media-playlist-repeat-symbolic",
				       TRUE, FALSE);
  
  gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
  gtk_widget_show (button);
  /* volume */
  button = gtk_volume_button_new ();
  gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), 1);
  g_settings_bind (settings, "volume", button, "value",
                   G_SETTINGS_BIND_DEFAULT);
  gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  gtk_header_bar_pack_end (GTK_HEADER_BAR (self), box);
  gtk_widget_show (box);
}
开发者ID:mgyugcha,项目名称:garu-music-player,代码行数:34,代码来源:garu-headerbar.c


示例12: tuner_set_squelch

void
tuner_set_squelch()
{
    gchar buffer[5];
    g_snprintf(buffer, sizeof(buffer), "Q%ld", lround(gtk_scale_button_get_value(GTK_SCALE_BUTTON(ui.squelch))));
    tuner_write(tuner.thread, buffer);
    tuner.last_set_squelch = g_get_real_time() / 1000;
}
开发者ID:kkonradpl,项目名称:xdr-gtk,代码行数:8,代码来源:ui-tuner-set.c


示例13: update_mastervol

static void
update_mastervol(void *opaque, float value)
{
  playdeck_t *pd = opaque;

  value = (value / 75.0) + 1;
  gtk_scale_button_set_value(GTK_SCALE_BUTTON(pd->volume), value);
}
开发者ID:Allba,项目名称:showtime,代码行数:8,代码来源:gu_playdeck.c


示例14: headerbarui_volume_changed

gboolean
headerbarui_volume_changed(gpointer user_data)
{
    float volume = deadbeef->volume_get_min_db()-deadbeef->volume_get_db();
    g_assert_false((volume>0));
    gtk_scale_button_set_value( GTK_SCALE_BUTTON (volbutton), (int)-volume );
    return FALSE;
}
开发者ID:tvannahl,项目名称:ddb_misc_headerbar_GTK3,代码行数:8,代码来源:headerbarui.c


示例15: g_signal_handler_block

void FullscreenVideoControllerGtk::muteChanged()
{
    if (!m_volumeButton)
        return;

    g_signal_handler_block(m_volumeButton, m_volumeUpdateId);
    gtk_scale_button_set_value(GTK_SCALE_BUTTON(m_volumeButton), m_player->muted() ? 0 : m_player->volume());
    g_signal_handler_unblock(m_volumeButton, m_volumeUpdateId);
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:9,代码来源:FullscreenVideoControllerGtk.cpp


示例16: ui_volume_slider_update

static gboolean ui_volume_slider_update(gpointer data)
{
    gint volume;

    if (volume_slider_is_moving || data == NULL)
        return TRUE;

    aud_drct_get_volume_main(&volume);

    if (volume == (gint) gtk_scale_button_get_value(GTK_SCALE_BUTTON(data)))
        return TRUE;

    g_signal_handler_block(data, volume_change_handler_id);
    gtk_scale_button_set_value(GTK_SCALE_BUTTON(data), volume);
    g_signal_handler_unblock(data, volume_change_handler_id);

    return TRUE;
}
开发者ID:viking,项目名称:audacious-plugins,代码行数:18,代码来源:ui_gtk.c


示例17: gtk_window_new

void FullscreenVideoControllerGtk::createHud()
{
    m_hudWindow = gtk_window_new(GTK_WINDOW_POPUP);
    gtk_window_set_gravity(GTK_WINDOW(m_hudWindow), GDK_GRAVITY_SOUTH_WEST);
    gtk_window_set_type_hint(GTK_WINDOW(m_hudWindow), GDK_WINDOW_TYPE_HINT_NORMAL);

    m_hudMotionNotifySignalId = g_signal_connect(m_hudWindow, "motion-notify-event", G_CALLBACK(onFullscreenGtkMotionNotifyEvent), this);

#ifdef GTK_API_VERSION_2
    GtkWidget* hbox = gtk_hbox_new(FALSE, 4);
#else
    GtkWidget* hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
#endif
    gtk_container_add(GTK_CONTAINER(m_hudWindow), hbox);

    m_playPauseAction = gtk_action_new("play", _("Play / Pause"), _("Play or pause the media"), PAUSE_ICON_NAME);
    m_playActionActivateSignalId = g_signal_connect(m_playPauseAction, "activate", G_CALLBACK(togglePlayPauseActivated), this);

    GtkWidget* item = gtk_action_create_tool_item(m_playPauseAction);
    gtk_box_pack_start(GTK_BOX(hbox), item, FALSE, TRUE, 0);

    GtkWidget* label = gtk_label_new(_("Time:"));
    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0);

    GtkAdjustment* adjustment = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 100.0, 0.1, 1.0, 1.0));
#ifdef GTK_API_VERSION_2
    m_timeHScale = gtk_hscale_new(adjustment);
#else
    m_timeHScale = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, adjustment);
#endif
    gtk_scale_set_draw_value(GTK_SCALE(m_timeHScale), FALSE);
    gtk_range_set_show_fill_level(GTK_RANGE(m_timeHScale), TRUE);
    m_timeScaleButtonPressedSignalId = g_signal_connect(m_timeHScale, "button-press-event", G_CALLBACK(timeScaleButtonPressed), this);
    m_timeScaleButtonReleasedSignalId = g_signal_connect(m_timeHScale, "button-release-event", G_CALLBACK(timeScaleButtonReleased), this);
    m_hscaleUpdateId = g_signal_connect(m_timeHScale, "value-changed", G_CALLBACK(timeScaleValueChanged), this);

    gtk_box_pack_start(GTK_BOX(hbox), m_timeHScale, TRUE, TRUE, 0);

    m_timeLabel = gtk_label_new("");
    gtk_box_pack_start(GTK_BOX(hbox), m_timeLabel, FALSE, TRUE, 0);

    // Volume button.
    m_volumeButton = gtk_volume_button_new();
    gtk_box_pack_start(GTK_BOX(hbox), m_volumeButton, FALSE, TRUE, 0);
    gtk_scale_button_set_value(GTK_SCALE_BUTTON(m_volumeButton), m_player->volume());
    m_volumeUpdateId = g_signal_connect(m_volumeButton, "value-changed", G_CALLBACK(volumeValueChanged), this);

    m_exitFullscreenAction = gtk_action_new("exit", _("Exit Fullscreen"), _("Exit from fullscreen mode"), EXIT_FULLSCREEN_ICON_NAME);
    m_exitFullcreenActionActivateSignalId = g_signal_connect(m_exitFullscreenAction, "activate", G_CALLBACK(exitFullscreenActivated), this);
    g_object_set(m_exitFullscreenAction, "icon-name", EXIT_FULLSCREEN_ICON_NAME, NULL);
    item = gtk_action_create_tool_item(m_exitFullscreenAction);
    gtk_box_pack_start(GTK_BOX(hbox), item, FALSE, TRUE, 0);

    m_progressBarUpdateId = g_timeout_add(PROGRESS_BAR_UPDATE_INTERVAL, reinterpret_cast<GSourceFunc>(progressBarUpdateCallback), this);

    playStateChanged();
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:57,代码来源:FullscreenVideoControllerGtk.cpp


示例18: tuner_set_volume

void
tuner_set_volume()
{
    gchar buffer[5];
    conf.volume = lround(gtk_scale_button_get_value(GTK_SCALE_BUTTON(ui.volume)));
    g_snprintf(buffer, sizeof(buffer), "Y%d", conf.volume);
    tuner_write(tuner.thread, buffer);
    tuner.last_set_volume = g_get_real_time() / 1000;
}
开发者ID:kkonradpl,项目名称:xdr-gtk,代码行数:9,代码来源:ui-tuner-set.c


示例19: autoquality_toggled

static void
autoquality_toggled(GtkToggleButton *button, CurrentCallView *self)
{
    g_return_if_fail(IS_CURRENT_CALL_VIEW(self));
    CurrentCallViewPrivate *priv = CURRENT_CALL_VIEW_GET_PRIVATE(self);

    gboolean auto_quality_on = gtk_toggle_button_get_active(button);

    auto scale = gtk_scale_button_get_scale(GTK_SCALE_BUTTON(priv->scalebutton_quality));
    auto plus_button = gtk_scale_button_get_plus_button(GTK_SCALE_BUTTON(priv->scalebutton_quality));
    auto minus_button = gtk_scale_button_get_minus_button(GTK_SCALE_BUTTON(priv->scalebutton_quality));

    gtk_widget_set_sensitive(GTK_WIDGET(scale), !auto_quality_on);
    gtk_widget_set_sensitive(plus_button, !auto_quality_on);
    gtk_widget_set_sensitive(minus_button, !auto_quality_on);

    double desired_quality = gtk_scale_button_get_value(GTK_SCALE_BUTTON(priv->scalebutton_quality));

    if (priv->call)
        set_quality(priv->call, auto_quality_on, desired_quality);
}
开发者ID:eXcomm,项目名称:ring-client-gnome,代码行数:21,代码来源:currentcallview.cpp


示例20: quality_button_released

static gboolean
quality_button_released(G_GNUC_UNUSED GtkWidget *widget, G_GNUC_UNUSED GdkEvent *event, CurrentCallView *self)
{
    g_return_val_if_fail(IS_CURRENT_CALL_VIEW(self), FALSE);
    CurrentCallViewPrivate *priv = CURRENT_CALL_VIEW_GET_PRIVATE(self);

    priv->quality_scale_pressed = FALSE;

    /* now make sure the quality gets updated */
    quality_changed(GTK_SCALE_BUTTON(priv->scalebutton_quality), 0, self);

    return GDK_EVENT_PROPAGATE;
}
开发者ID:eXcomm,项目名称:ring-client-gnome,代码行数:13,代码来源:currentcallview.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_SCROLLABLE函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_SCALE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap