Paned (Python) Marta Maria Casetti mmcasetti@gmail.com 2012 크기 조절 가능한 두 창을 가진 위젯입니다 조성호 shcho@gnome.org 2017 Paned

크기 조절 가능한 두 창에 그림 둘을 두고 수평 방향으로 정렬합니다.

예제 결과를 만드는 코드 from gi.repository import Gtk import sys class MyWindow(Gtk.ApplicationWindow): def __init__(self, app): Gtk.Window.__init__(self, title="Paned Example", application=app) self.set_default_size(450, 350) # a new widget with two adjustable panes, # one on the left and one on the right paned = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL) # two images image1 = Gtk.Image() image1.set_from_file("gnome-image.png") image2 = Gtk.Image() image2.set_from_file("tux.png") # add the first image to the left pane paned.add1(image1) # add the second image to the right pane paned.add2(image2) # add the panes to the window self.add(paned) class MyApplication(Gtk.Application): def __init__(self): Gtk.Application.__init__(self) def do_activate(self): win = MyWindow(self) win.show_all() def do_startup(self): Gtk.Application.do_startup(self) app = MyApplication() exit_status = app.run(sys.argv) sys.exit(exit_status)
Paned 위젯에 쓸만한 메서드

수직 처리 창을 두려면 Gtk.Orientation.HORIZONTAL 대신 Gtk.Orientation.VERTICAL를 사용하십시오. add1(widget1) 메서드는, 최상단 창에 widget1를 추가하며, add2(widget2) 메서드는 하단 창에 widget2를 추가합니다.

API 참고서

이 예제는 다음 참고자료가 필요합니다:

GtkPaned

표준 에뮬레이션

GtkImage