Advertisement
1400_SpaceCat

Scrolledwindow

May 10th, 2016
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.16 KB | None | 0 0
  1. from gi.repository import Gtk as gtk
  2. from gi.repository import Gdk as gdk
  3.  
  4. class app:
  5.     def __init__(self):
  6.         window_main = gtk.Window()
  7.         window_main.set_size_request(gdk.Screen.get_default().get_width(),0)
  8.         window_main.set_name("window_main")
  9.         window_main.move(0,0)
  10.         window_main.set_keep_above(True)
  11.         window_main.set_resizable(False)
  12.         window_main.set_decorated(False)
  13.         window_main.set_border_width(0)
  14.         window_main.connect("destroy",lambda e: gtk.main_quit())
  15.  
  16.         #create widgets for "categories place"#
  17.         box_main = gtk.HBox()
  18.  
  19.         scrolledwindow_categories = gtk.ScrolledWindow()
  20.         scrolledwindow_categories.set_policy(
  21.             gtk.PolicyType.AUTOMATIC,
  22.             gtk.PolicyType.NEVER
  23.             )
  24.         scrolledwindow_categories.set_size_request(20,20)
  25.        
  26.         viewport_categories = gtk.Viewport()
  27.         viewport_categories.add(box_main)
  28.         scrolledwindow_categories.add(viewport_categories)
  29.         window_main.add(scrolledwindow_categories)
  30.  
  31.         notebook_categories = gtk.Notebook()
  32.         box_main.add(notebook_categories)
  33.  
  34.         for i in range(20):
  35.             button = gtk.Button("Button")
  36.             notebook_categories.append_page(button,gtk.Label("Text"))
  37.  
  38.         window_main.show_all()
  39.         gtk.main()
  40.  
  41. app()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement