Home > backend, GSOC2015, kivy, matplotlib > Navigation Toolbar for #kivympl using an Action Bar

Navigation Toolbar for #kivympl using an Action Bar

After my last post I started the implementation of a Navigation Toolbar for the backend. For the Navigation Toolbar for kivy we decided to experiment with an ActionBar from the set of kivy widgets. It is a very early version and not implemented at all, but this is a snippet of how it would be the layout and the result can be seen on the image below. The only element being used for now are the icons for the action buttons so we can have an idea of how it would look like.  The behavior of each one of the items will be defined on the callbacks. The NavigationToolbar2Kivy extends from NavigationToolbar2 which is the base class.

def _init_toolbar(self):
        basedir = os.path.join(rcParams['datapath'], 'images')
        actionbar = ActionBar(pos_hint={'bottom': 1.0})
        actionview = ActionView()
        for text, tooltip_text, image_file, callback in self.toolitems:
            if text is None:
                # insert a separator
            fname = os.path.join(basedir, image_file + '.png')
            action_button = ActionButton(text=text, icon=fname)
        self.canvas.add_widget(actionbar, canvas='after')

Navigation Toolbar Kivy MPL

  1. No comments yet.
  1. No trackbacks yet.