Development Team/Almanac/sugar.graphics.toolbox: Difference between revisions

No edit summary
 
(13 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Almanac}}
{{Almanac TOC}}
= Class: Toolbox([http://www.pygtk.org/docs/pygtk/ gtk.VBox]) =
= Class: Toolbox([http://www.pygtk.org/docs/pygtk/ gtk.VBox]) =


Line 14: Line 16:


=== How do I remove a toolbar from a toolbox? ===
=== How do I remove a toolbar from a toolbox? ===
In order to remove a toolbar from a toolbox, you first need to know the index of that toolbar so you can pass it to the remove_toolbar() method. Once you know this, you can run something like:
        #Remove the toolbar with index number 1.
        toolbox.remove_toolbar(1)


=== How do I programmatically change the active toolbar in a toolbox? ===
=== How do I programmatically change the active toolbar in a toolbox? ===
The "set_current_toolbar()" method in the ToolBox class allows you to programmatically set which toolbar is active.
        #Set the active toolbar using an integer index assigned to each toolbar in your activity.
        self.toolbox.set_current_toolbar(1);
=== How do I remove the separator at the bottom of my toolbar? ===
In your activity subclass, do the following:
<pre>
self.toolbox = activity.ActivityToolbox(self)
self.set_toolbox(self.toolbox)
self.toolbox.remove(self.toolbox._separator)
</pre>