All pastes #771024 Raw Edit

Someone

public ruby v1 · immutable
·published 2007-11-12 19:28 UTC
rendered paste body
# The main window of the applicationclass MainWindow  < KDE::XmlGuiWindow    def initialize        super                # The main tabWidget, which is also the central widget        @tabWidget = KDE::TabWidget.new(self)        @tabWidget.addTab(KDE::TextEdit.new, "Placeholder")        setCentralWidget( @tabWidget )                #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv        # The MultiTabBar is those bottons around the central widget, think sidebar        @multiTabBar = KDE::MultiTabBar.new(KDE::MultiTabBar::Left, self)        @multiTabBar.appendTab(KDE::IconLoader.new.loadIcon("cookies", KDE::IconLoader::Toolbar),-1,"Cookies")        #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                setupActions    end        def setupActions        cookieAction = KDE::Action.new(self)        cookieAction.setText(KDE::i18n("Cookie"))        cookieAction.setIcon(KDE::Icon.new("cookies"))        connect(cookieAction, SIGNAL('triggered(bool)')){            @tabWidget.removeTab(0) # FILLER        }        actionCollection().addAction("cookie", cookieAction )                KDE::StandardAction::quit(KDE::Application::KApp, SLOT('quit()'), actionCollection())                # The finishing touch, this basically loads the rc file in working directory        setupGUI( KDE::XmlGuiWindow::Default, Dir.getwd+"/gui.rc" )    endend