Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to implement hide function in my application. What I want is to have this little arrow ">" when is hide and "V" when is visible. I know how to make it so its hides and shows but I need that little arrow to change whenever I click on it....

I'm using quickly and python to create my app. I tried set_icon_from_stock function but it returns error:

AttributeError: 'ToolButton' object has no attribute 'set_icon_from_stock'

Above example of arrow I talking about.

Thanks

enter image description here

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Just use an Expander, that's what Update Manager is using here, too. It's drawing the arrows and taking care about to show and hide what's inside.

Screenshot Glade

share|improve this answer
    
Oh my sweet lord ;-) I will never forget this again... thank you so much! –  Majster-pl Aug 13 '12 at 22:37

http://www.pygtk.org/docs/pygtk/class-gtktoolbutton.html

The icon of a gtk.ToolButton is determined by the properties "icon-widget" and "stock-id". If "icon-widget" specifies a gtk.Widget, that widget is used as the icon. If "icon-widget" is None, the icon is determined by the stock item specified by "stock-id". If both "icon-widget" and "stock-id" are None, the button does not have an icon.

The set_stock_id() method sets the "stock-id" property to the value of stock_id. The stock item specified by stock_id is used to determine the icon and label if not overridden by the "label" and "icon-widget" properties. See the gtk.ToolButton() constructor for more information.

The set_icon_name() method sets the "icon-name" property to the value of icon_name. The themed icon name specified by icon_name is used to determine the icon for the toolbutton if not overridden by the "label", "stock-id" and "icon-widget" properties. See the gtk.ToolButton() constructor for more information.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.