Logo Search packages:      
Sourcecode: accerciser version File versions

def accerciser::main_window::AccerciserMainWindow::_populateUI (   self,
  node 
) [private]

Populate the top level window widget.

@param node: Main application's node.
@type node: L{Node}

Definition at line 50 of file main_window.py.

00050                              :
    '''
    Populate the top level window widget.
    
    @param node: Main application's node.
    @type node: L{Node}
    '''
    main_vbox = gtk.VBox()
    menu_bar = ui_manager.uimanager.get_widget(ui_manager.MAIN_MENU_PATH)
    main_vbox.pack_start(menu_bar, False)
    self._vpaned = gtk.VPaned()
    self._vpaned.set_position(350)
    self._vpaned.set_name('vpaned')
    main_vbox.pack_start(self._vpaned)
    self.statusbar = gtk.Statusbar()
    main_vbox.pack_start(self.statusbar, False)
    self._hpaned = gtk.HPaned()
    self._hpaned.set_position(250)
    self._hpaned.set_name('hpaned')
    self._vpaned.add1(self._hpaned)
    self.pluginview1 = PluginView(N_('Top panel'))
    self.pluginview2 = PluginView(N_('Bottom panel'))
    self.pluginview2.connect('page_added', 
                              self._onBottomPanelChange, 'added')
    self.pluginview2.connect('page_removed', 
                              self._onBottomPanelChange, 'removed')
    self.pluginview2.connect_after('realize', self._onBottomPanelRealize)
    self._vpaned.add2(self.pluginview2)
    self._hpaned.add2(self.pluginview1)
    sw = gtk.ScrolledWindow()
    sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
    sw.set_shadow_type(gtk.SHADOW_IN)
    self.treeview = AccessibleTreeView(node)
    ui_manager.uimanager.insert_action_group(self.treeview.action_group, 0)
    for action in self.treeview.action_group.list_actions():
      merge_id = ui_manager.uimanager.new_merge_id()
      action_name = action.get_name()
      ui_manager.uimanager.add_ui(merge_id, ui_manager.TREE_ACTIONS_PATH, 
                                  action_name, action_name, 
                                  gtk.UI_MANAGER_MENUITEM, False)

    sw.add(self.treeview)
    self._hpaned.add1(sw)

    cl = gconf.client_get_default()
    for paned in (self._vpaned, self._hpaned):
      if not cl.get(GCONF_GENERAL+'/'+paned.name): continue
      paned_position = cl.get_int(GCONF_GENERAL+'/'+paned.name)
      paned.set_position(paned_position)
      paned.set_data('last_position', paned.get_position())

    self.add(main_vbox)

  def _onBottomPanelChange(self, pluginview, page, page_num, action):


Generated by  Doxygen 1.6.0   Back to index