Ejemplo n.º 1
0
def demo():
    from twisted.internet import reactor, tksupport
    from shtoom.ui.slider import SliderDemo

    class TkDemoWindow(TkSlidingWindow):

        def __init__(self, parent):
            from Tkinter import Tk, Label, Button
            self.parent = parent
            self.win = Tk(className='moving')
            self.win.overrideredirect(1)
            self.win.tkraise()
            self.label = Label(self.win, text=' '*25, font='fixed')
            self.label.pack(padx=20, pady=10)
            self.button = Button(self.win, text='OK', command=self.parent.hide)
            self.button.pack(pady=5)
            tksupport.install(self.win)

        def demoText(self, text):
            self.label.configure(text=text)
            self.win.geometry('+%d+%d'%self.getScreenSize())
            self.label.pack()

    demo = SliderDemo(TkDemoWindow)
    demo.demo()
Ejemplo n.º 2
0
def demo():
    from twisted.internet import reactor, tksupport
    from shtoom.ui.slider import SliderDemo
    import gtk

    class GtkDemoWindow(GtkSlidingWindow):
        def __init__(self, parent):
            self.parent = parent
            self.win = gtk.Window(gtk.WINDOW_POPUP)
            self.frame = gtk.Frame("Shtoom - Notice")
            self.frame.set_border_width(8)
            vbox = gtk.VBox(False, 2)
            vbox.set_border_width(8)
            self.frame.add(vbox)
            self.label = gtk.Label(' ' * 25)
            vbox.pack_start(self.label)
            # Standard message dialog
            hbox = gtk.HBox(False, 5)
            vbox.pack_start(gtk.HSeparator(), False, False, 0)
            button = gtk.Button('Ok')
            button.connect('clicked', lambda x: self.slider.hide())
            hbox.pack_start(button, False, False, 0)
            vbox.pack_start(hbox, expand=False)
            self.win.add(self.frame)
            self.win.resize(200, 150)
            print("done", self.win)
            self.win.show()

        def demoText(self, text):
            self.label.set_text(text)

        def setSlider(self, slider):
            self.slider = slider

    demo = SliderDemo(GtkDemoWindow)
    demo.demo()
Ejemplo n.º 3
0
def demo():
    from twisted.internet import reactor, tksupport
    from shtoom.ui.slider import SliderDemo
    import gtk

    class GtkDemoWindow(GtkSlidingWindow):
        def __init__(self, parent):
            self.parent = parent
            self.win = gtk.Window(gtk.WINDOW_POPUP)
            self.frame = gtk.Frame("Shtoom - Notice")
            self.frame.set_border_width(8)
            vbox = gtk.VBox(False,2)
            vbox.set_border_width(8)
            self.frame.add(vbox)
            self.label = gtk.Label(' '*25)
            vbox.pack_start(self.label)
            # Standard message dialog
            hbox = gtk.HBox(False, 5)
            vbox.pack_start(gtk.HSeparator(), False, False, 0)
            button = gtk.Button('Ok')
            button.connect('clicked', lambda x: self.slider.hide())
            hbox.pack_start(button, False, False, 0)
            vbox.pack_start(hbox, expand=False)
            self.win.add(self.frame)
            self.win.resize(200, 150)
            print "done", self.win
            self.win.show()

        def demoText(self, text):
            self.label.set_text(text)

        def setSlider(self, slider):
            self.slider = slider

    demo = SliderDemo(GtkDemoWindow)
    demo.demo()