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


C++ GTK_SCALE_BUTTON函数代码示例

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


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


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