Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gi.repository import Gtk
- from gi.repository import Gdk
- def revealer_child(button):
- if revealer.get_reveal_child():
- revealer.set_reveal_child(False)
- revealer.hide()
- else:
- revealer.set_reveal_child(True)
- revealer.show()
- window = Gtk.Window()
- window.set_size_request(Gdk.Screen.get_default().get_width(),20)
- window.connect('destroy',Gtk.main_quit)
- window.set_size_request(
- Gdk.Screen.get_default().get_width(),
- 20)
- grid = Gtk.Grid()
- window.add(grid)
- revealer = Gtk.Revealer()
- revealer.set_reveal_child(False)
- grid.attach(revealer,0,1,1,1)
- notebook = Gtk.Notebook()
- for i in range(10):
- box = Gtk.Box()
- box.set_size_request(
- Gdk.Screen.get_default().get_width(),
- Gdk.Screen.get_default().get_height())
- container = Gtk.FlowBox()
- container.set_valign(Gtk.Align.START)
- container.set_max_children_per_line(30)
- container.set_selection_mode(Gtk.SelectionMode.NONE)
- for j in range(10):
- button = Gtk.Button("%d" % i)
- container.add(button)
- box.add(container)
- notebook.append_page(box,Gtk.Label("Label"))
- revealer.add(notebook)
- button = Gtk.Button("Revealer")
- button.connect("clicked",revealer_child)
- grid.attach(button,0,0,1,1)
- window.show_all()
- Gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement