All pastes #771010 Raw Edit

Someone

public ruby v1 · immutable
·published 2007-11-12 19:17 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 )                # The MultiTabBar is those bottons around the central widget, think sidebar        @multiTabBar = KDE::MultiTabBar.new(KDE::MultiTabBar::Bottom, 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)        }        actionCollection().addAction("cookie", cookieAction )                KDE::StandardAction::quit(KDE::Application::KApp, SLOT('quit()'), actionCollection())                # The finishing touch        setupGUI( KDE::XmlGuiWindow::Default, Dir.getwd+"/gui.rc" )    endend