Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gi.repository import Gtk
- from gi.repository import Gdk
- class app:
- def __init__(self):
- self.value = 50
- win = Gtk.Window()
- win.connect("delete_event", Gtk.main_quit)
- win.set_default_size(300,100)
- box = Gtk.Box()
- self.button_p = Gtk.Button(">")
- self.button_p.connect("clicked",self.plus)
- self.button_m = Gtk.Button("<")
- self.button_m.connect("clicked",self.minus)
- self.scroll = Gtk.ScrolledWindow(None, None)
- view = Gtk.Viewport(None, None)
- label = Gtk.Label('''
- \rsome text
- \rsome shit
- \rshit''')
- view.add(label)
- self.scroll.add(view)
- box.pack_start(self.button_p,True,True,0)
- box.pack_start(self.button_m,True,True,0)
- box.pack_start(self.scroll,True,True,0)
- win.add(box)
- win.show_all()
- self.position = self.scroll.get_vadjustment()
- self.position.set_value(self.value)
- # self.scroll.set_vadjustment(self.position)
- Gtk.main()
- def plus(self,e):
- self.value += 10
- self.scroll.set_vadjustment(self.position)
- def minus(self,e):
- self.value -= 10
- self.scroll.set_vadjustment(self.position)
- app()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement