2014-05-13 3 views

답변

1

Gtk.StackSwitcher를 의미합니까? Gtk.Stack은 Gtk.StackSwitcher가 "헤더"가되는 빈 컨테이너입니다.

from gi.repository import Gtk 

    win = Gtk.Window() 
    grid = Gtk.Grid() 
    win.add (grid) 

    stack = Gtk.Stack() 
    childstack = Gtk.Entry() 
    stack.add_titled (childstack, "_Namestack", "LabelInTheSwitcher") 
    grid.attach (stack, 0, 1, 1, 1) 

    switcher = Gtk.StackSwitcher() 
    switcher.set_stack (stack) 
    grid.attach (switcher, 0, 0, 1, 1) 

    """ Use icon instead for your switcher """ 
    stack.child_set_property (childstack, "icon-name", "help-about") 


    win.show_all() 
    win.connect ("destroy", Gtk.main_quit) 

    Gtk.main() 
+0

굉장한 응답! 고마워요! – costales

+0

잘 작동하지만 아이콘이 조금 더 낮습니다 (1px 높이, 스크린 샷 참조 : http://goo.gl/7Sl10A). StackSwitcher와 동일한 높이를 설정할 수 있습니까? 나는 해결책을 찾지 못했다. (미리 감사드립니다. luciomrx! – costales

+1

그게 내가 해결할 수 없었던 것입니다. 그것은 위젯 각각에 대한 Gtk.Widget의 높이를 할당하는 방법 일뿐입니다. – luciomrx