當前位置: 首頁>>代碼示例>>Python>>正文


Python Box.height方法代碼示例

本文整理匯總了Python中gaphas.examples.Box.height方法的典型用法代碼示例。如果您正苦於以下問題:Python Box.height方法的具體用法?Python Box.height怎麽用?Python Box.height使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gaphas.examples.Box的用法示例。


在下文中一共展示了Box.height方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_get_item_at_point

# 需要導入模塊: from gaphas.examples import Box [as 別名]
# 或者: from gaphas.examples.Box import height [as 別名]
    def test_get_item_at_point(self):
        """
        Hover tool only reacts on motion-notify events
        """
        canvas = Canvas()
        view = GtkView(canvas)
        window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        window.add(view)
        window.show_all()

        box = Box()
        canvas.add(box)
        # No gtk main loop, so updates occur instantly
        assert not canvas.require_update()
        box.width = 50
        box.height = 50

        # Process pending (expose) events, which cause the canvas to be drawn.
        while gtk.events_pending():
            gtk.main_iteration()

        assert len(view._qtree._ids) == 1
        assert not view._qtree._bucket.bounds == (0, 0, 0, 0), view._qtree._bucket.bounds

        assert view.get_item_at_point((10, 10)) is box
        assert view.get_item_at_point((60, 10)) is None

        window.destroy()
開發者ID:pcakapratibha,項目名稱:gaphas,代碼行數:30,代碼來源:test_view.py

示例2: test_line_projection

# 需要導入模塊: from gaphas.examples import Box [as 別名]
# 或者: from gaphas.examples.Box import height [as 別名]
    def test_line_projection(self):
        """Test projection with line's handle on element's side"""
        line = Line()
        line.matrix.translate(15, 50)
        h1, h2 = line.handles()
        h1.x, h1.y = 0, 0
        h2.x, h2.y = 20, 20

        box = Box()
        box.matrix.translate(10, 10)
        box.width = 40
        box.height = 20
        h_nw, h_ne, h_se, h_sw = box.handles()

        canvas = Canvas()
        canvas.add(line)
        canvas.add(box)

        # move line's second handle on box side
        h2.x, h2.y = 5, -20
開發者ID:adrianboguszewski,項目名稱:gaphas,代碼行數:22,代碼來源:test_canvas.py


注:本文中的gaphas.examples.Box.height方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。