本文整理匯總了Python中gaphas.examples.Box.min_height方法的典型用法代碼示例。如果您正苦於以下問題:Python Box.min_height方法的具體用法?Python Box.min_height怎麽用?Python Box.min_height使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gaphas.examples.Box
的用法示例。
在下文中一共展示了Box.min_height方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create_canvas
# 需要導入模塊: from gaphas.examples import Box [as 別名]
# 或者: from gaphas.examples.Box import min_height [as 別名]
def create_canvas(canvas, title):
# Setup drawing window
view = GtkView()
view.painter = DefaultPainter()
view.canvas = canvas
window = Gtk.Window()
window.set_title(title)
window.set_default_size(400, 400)
win_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
window.add(win_box)
win_box.pack_start(view, True, True, 0)
# Draw first gaphas box
b1 = Box(60, 60)
b1.matrix = (1.0, 0.0, 0.0, 1, 10, 10)
canvas.add(b1)
# Draw second gaphas box
b2 = Box(60, 60)
b2.min_width = 40
b2.min_height = 50
b2.matrix.translate(170, 170)
canvas.add(b2)
# Draw gaphas line
line = Line()
line.matrix.translate(100, 60)
canvas.add(line)
line.handles()[1].pos = (30, 30)
window.show_all()
window.connect("destroy", Gtk.main_quit)
示例2: test_get_handle_at_point
# 需要導入模塊: from gaphas.examples import Box [as 別名]
# 或者: from gaphas.examples.Box import min_height [as 別名]
def test_get_handle_at_point(self):
canvas = Canvas()
view = GtkView(canvas)
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.add(view)
window.show_all()
box = Box()
box.min_width = 20
box.min_height = 30
box.matrix.translate(20, 20)
box.matrix.rotate(math.pi/1.5)
canvas.add(box)
i, h = view.get_handle_at_point((20, 20))
assert i is box
assert h is box.handles()[0]