Adding a slider to AppIndicator (Ubuntu 11.04)
Asked Answered
F

1

21

I'm trying to add a slider to an AppIndicator similar to what the Sound Menu has.

I've looked through the code of the Sound Menu and found that I should be using libido-0.1.

Here's what I have so far:

indicator_menu = gtk_menu_new();
ido_slider_widget = ido_scale_menu_item_new_with_range("BRIGHTNESS", IDO_RANGE_STYLE_DEFAULT,  0, 0, 100, 1);
ido_scale_menu_item_set_primary_label(IDO_SCALE_MENU_ITEM(ido_slider_widget), "BRIGHTNESS");
ido_scale_menu_item_set_style(IDO_SCALE_MENU_ITEM(ido_slider_widget), IDO_SCALE_MENU_ITEM_STYLE_LABEL);
ido_scale_menu_item_set_primary_label(IDO_SCALE_MENU_ITEM(ido_slider_widget), " - ");
ido_scale_menu_item_set_secondary_label(IDO_SCALE_MENU_ITEM(ido_slider_widget), " + ");

GtkMenuItem *menu_slider_item = GTK_MENU_ITEM(ido_slider_widget);

gtk_menu_append(indicator_menu, GTK_WIDGET(menu_slider_item));
gtk_menu_append(indicator_menu, gtk_menu_item_new_with_label("dfdsfds"));

gtk_widget_show_all(indicator_menu);
gtk_widget_show_all(ido_slider_widget);

app_indicator_set_menu(indicator, GTK_MENU(indicator_menu));

All I see is a '-' symbol in the menu, how do I fix this?

Froghopper answered 31/7, 2011 at 19:26 Comment(0)
A
2

It has been a time I last worked with AppIndicator, but as far as I remember, you cannot add that kind of controls. You are limited to add standard menu entries.

Alumina answered 2/10, 2014 at 21:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.