本文整理汇总了Python中canvas.Canvas.set_size_request方法的典型用法代码示例。如果您正苦于以下问题:Python Canvas.set_size_request方法的具体用法?Python Canvas.set_size_request怎么用?Python Canvas.set_size_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类canvas.Canvas
的用法示例。
在下文中一共展示了Canvas.set_size_request方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _create_canvas
# 需要导入模块: from canvas import Canvas [as 别名]
# 或者: from canvas.Canvas import set_size_request [as 别名]
def _create_canvas(self, canvas_name):
canvas = Canvas()
canvas.set_size_request(self.DEFAULT_CANVAS_WIDTH, self.DEFAULT_CANVAS_WIDTH)
canvas.connect("button-press-event", self._on_canvas_button_press, canvas_name)
canvas.connect("drawing-stopped", self._on_canvas_drawing_stopped, canvas_name)
canvas.connect("stroke-added", self._on_canvas_stroke_added, canvas_name)
setattr(self, canvas_name, canvas)
frame = gtk.Frame()
frame.add(canvas)
setattr(self, canvas_name + "_frame", frame)