Tk庫的使用 1

2021-04-20 02:54:49 字數 993 閱讀 3067

#

# to change this template, choose tools | templates

# and open the template in the editor.

# sample code from programing ruby, page 248

require 'tk'

class draw

def do_press(x, y)

@start_x = x

@start_y = y

@current_line = tkcline.new(@canvas, x, y, x, y)

enddef do_motion(x, y)

if @current_line

@current_line.coords @start_x, @start_y, x, y

endend

def do_release(x, y)

if @current_line

@current_line.coords @start_x, @start_y, x, y

@current_line.fill 'black'

@current_line = nil

endend

def initialize(parent)

@canvas = tkcanvas.new(parent)

@canvas.pack

@start_x = @start_y = 0

@canvas.bind("1", lambda )

@canvas.bind("b1-motion",

lambda , "%x %y")

@canvas.bind("buttonrelease-1",

lambda ,

"%x %y")

endend

root = tkroot.new

draw.new(root)

tk.mainloop

Tk庫的使用 2

sample code from programing ruby,page 250 require tk class gifviewer def initialize filelist setup viewer filelist enddef run tk.mainloop enddef setup...

TK1 的環境配置

在頁面中做如下選擇,可以過濾出上面的2種包 product jetson tk1 hardware 全選 tools setup 其餘項 不選 接下來按照文章 種的描述進行刷機。安裝參考 參考 把tk1的解析度設定為1024 768,再連線hdmi顯示屏,即可。問題 連線hdmi顯示屏後,重啟tk1...

tk1 刷機血路

我也不知道為什麼要加粗 就是不爽吧可能 md,晚上拿了倆tk1刷機,本來我都刷過好幾次了,這不是小菜一碟麼 分分鐘搞定啊wc 結果 試了半天,都是刷一半,就找不到device 試了三個多小時啊 啊 刷機步驟按照此部落格來 最後一步 sudo flash.sh s 14gib jetson tk1mm...