Exemplo n.º 1
0
    def _application_window_create(self):

        application_window = gtk.VBox()
        #application_window.move(0, 0)
        #application_window.set_default_size(700, -1)
        #gtk.window_set_default_icon_from_file(join(pixmaps_dir,
        #                                           'gazpacho-icon.png'))
        #application_window.connect('delete-event', self._delete_event)

        # Create the different widgets
        menubar, toolbar = self._construct_menu_and_toolbar(application_window)

        self._palette = palette.Palette(self._catalogs)
        self._palette.connect('toggled', self._palette_button_clicked)

        self._editor = editor.Editor(self)

        widget_view = self._widget_tree_view_create()

        self.gactions_view = self._gactions_view_create()

        self._statusbar = self._construct_statusbar()

        # Layout them on the window
        main_vbox = gtk.VBox()
        application_window.add(main_vbox)

        top_box = gtk.HBox()
        main_vbox.pack_start(top_box, expand=False)

        top_box.pack_start(toolbar)
        top_box.pack_start(menubar, False)

        hbox = gtk.HBox(spacing=6)
        hbox.pack_start(self._palette, False, False)

        vpaned = gtk.HPaned()
        hbox.pack_start(vpaned, True, True)

        notebook = gtk.Notebook()
        notebook.append_page(widget_view, gtk.Label(_('Widgets')))
        notebook.append_page(self.gactions_view, gtk.Label(_('Actions')))
        notebook.set_size_request(200, -1)

        #vpaned.set_position(200)

        vpaned.pack1(notebook, True, True)
        vpaned.pack2(self._editor, True, True)
        self._editor.set_size_request(200, -1)

        main_vbox.pack_start(hbox)

        #main_vbox.pack_end(self._statusbar, False)

        self.refresh_undo_and_redo()

        return application_window
Exemplo n.º 2
0
    def _application_window_create(self):
        application_window = gtk.VBox()
        # Layout them on the window
        main_vbox = gtk.VBox()
        application_window.add(main_vbox)
        # Create actions that are always enabled

        hbox = gtk.HBox(spacing=6)
        main_vbox.pack_start(hbox)

        pal = palette.Palette()
        pal.connect('toggled', self._palette_button_clicked)
        pal_parent = pal.get_parent()
        if pal_parent is not None:
            pal_parent.remove(pal)
        hbox.pack_start(pal, False, False)

        vpaned = gtk.VPaned()
        vpaned.set_position(150)
        hbox.pack_start(vpaned, True, True)

        notebook = gtk.Notebook()
        vpaned.add1(notebook)

        # Widget view
        widget_view = WidgetTreeView(self)
        self._add_view(widget_view)
        page_num = notebook.append_page(widget_view, gtk.Label(('Widgets')))

        state = WidgetUIMState()
        self._uim_states[page_num] = state

        # Action view
        self.gactions_view = GActionsView(self)
        self._add_view(self.gactions_view)
        page_num = notebook.append_page(self.gactions_view,
                                        gtk.Label(('Actions')))

        state = ActionUIMState(self.gactions_view)
        self._uim_states[page_num] = state

        # Sizegroup view
        self.sizegroup_view = SizeGroupView(self)
        self._add_view(self.sizegroup_view)
        page_num = notebook.append_page(self.sizegroup_view,
                                        gtk.Label(('Size Groups')))

        state = SizeGroupUIMState(self.sizegroup_view)
        self._uim_states[page_num] = state

        # Add property editor
        self._editor = widget_editor(self)
        self._editor.row_activated_cb = self.cb_signal_activated
        vpaned.add2(self._editor)

        notebook.connect('switch-page', self._switch_page_cb)

        # Statusbar
        statusbar = gtk.Statusbar()
        self._statusbar_menu_context_id = statusbar.get_context_id("menu")
        self._statusbar_actions_context_id = statusbar.get_context_id(
            "actions")
        main_vbox.pack_end(statusbar, False)
        self._statusbar = statusbar

        # dnd doesn't seem to work with Konqueror, at least not when
        # gtk.DEST_DEFAULT_ALL or gtk.DEST_DEFAULT_MOTION is used. If
        # handling the drag-motion event it will work though, but it's
        # a bit tricky.
        #application_window.drag_dest_set(gtk.DEST_DEFAULT_ALL,
        #                                 Application.targets,
        #                                 gtk.gdk.ACTION_COPY)

        #application_window.connect('drag_data_received',
        #                           self._dnd_data_received_cb)

        # Enable the current state
        self._active_uim_state = self._uim_states[0]
        #self._active_uim_state.enable()

        return application_window