2010年4月27日 星期二

TCL寫的自動對齊Instance小程式






























選取區域,該區域內Instance可上下或左右,0度或90度自動對齊
lakerMessage "$inst_id_pos_list" 這個可在Main Window顯示結果
下面可把laker form UI置於螢幕中心
###################return SCREEN center x y#####################################################################################################
proc get_screen_center {} {
set sc [car [exec xrandr | grep \*]]
regsub -all {x} $sc " " sxy
set x [atoi [car $sxy]] ;# screen x atoi字串轉整數,atof轉小數
set y [atoi [cadr $sxy]] ;# screen y atoi字串轉整數,atof轉小數
set cx [expr ($x)/2]
set cy [expr ($y)/2]
set sc_list [list $cx $cy] ;# screen center list
return $sc_list ;#回傳screen center list
}
######################set form ui SCREEN center#########################################################################################
proc set_form_screen_center {form_name} {

set nBcenter [get_screen_center] ;#取得螢幕中心點
set x [car [car [gtGetBBox -name $form_name]]] ;#取得視窗width
set y [cadr [car [gtGetBBox -name $form_name]]];#取得視窗height
set x1 [car $nBcenter]
set y1 [cadr $nBcenter]
set nx [expr $x1-$x/2]
set ny [expr $y1-$y/2]
set nnc [ list $nx $ny ]
gtSetOrigin -name $form_name -orig $nnc ;#將視窗置於螢幕中心
}
#############################################MAIN proc###################################################################################





read more...

2010年4月24日 星期六

再生龍安裝到eeepc 1000的sdb4


我試照這下面網頁做,想將再生龍裝到sdb4,notebook就能直接備份或還原,就不需要在燒一片live光碟(或live-usb),這樣是比較方便,
http://drbl.nchc.org.tw/clonezilla/clonezilla-live/livehd.php
可是在GRUB2開機一直無法成功
嘗試幾次後發現只要加入
search --no-floppy --fs-uuid --set 5ff3e30c-2d11-4ad6-8814-150f5da933d4
GRUB2就能正確啟動再生龍
這是5ff3e30c-2d11-4ad6-8814-150f5da933d4(原來這只是標籤,Gparted沒給標籤就會出現一長串),掛載上分割區的標籤,那如何得知,很簡單,ubuntu-位置-點選該裝置就會被掛載,終端機下ls /media就會出現

ls /media
5ff3e30c-2d11-4ad6-8814-150f5da933d4

我的/etc/grub.d$ sudo vi 40_custom如下





#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Clonezilla-live-1.2.5-2-686" {
set root=(hd1,4)
search --no-floppy --fs-uuid --set 5ff3e30c-2d11-4ad6-8814-150f5da933d4
linux /live-hd/vmlinuz boot=live union=aufs vga=788 ip=frommedia live-media-path=/live-hd bootfrom=/dev/sdb4 toram=filesystem.squashfs
initrd /live-hd/initrd.img
}

netbook OS:ubuntu 10.04(裝在16G記憶卡),硬碟裝有其他2套OS
硬碟分割器:Gparted

read more...

2010年4月15日 星期四

更新UBUNTU10.04到最新狀態








































最近把UBUNTU10.04更新到最新狀態,核心是2.6.32-21,
Rhythmbox裡有Ubuntu one音樂下載.
整個用起來感覺不錯,非常順暢,10.04使用上,比前幾個版本更好用.
預設畫面也比以前土黃色主體來的好看
本來ubuntu10.04是Firefox+預設Yahoo搜索,不過最後決定還是Firefox+預設google,Linux迷應該還滿高興的,還是google好.





read more...