mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/treectrl/tktreectrl.rb: performance tuning. (call tk_send_without_enc
if possible) * sample/tkextlib/treectrl/*.rb: some speed up... cache the result of version checking. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9961c29c25
commit
138b4c427c
11 changed files with 110 additions and 76 deletions
|
@ -13,7 +13,7 @@ def demoMailWasher(t)
|
|||
|
||||
pad = 4
|
||||
|
||||
if (TkPackage.vcompare(Tk::TreeCtrl.package_version, '1.1') >= 0)
|
||||
if $Version_1_1_OrLater
|
||||
t.column_create(:text=>'Delete', :textpadx=>pad, :tag=>'delete')
|
||||
t.column_create(:text=>'Bounce', :textpadx=>pad, :tag=>'bounce')
|
||||
t.column_create(:text=>'Status', :width=>80, :textpadx=>pad,
|
||||
|
@ -70,7 +70,7 @@ def demoMailWasher(t)
|
|||
t.element_create('txtBlacklist', :text, :text=>'Blacklisted', :lines=>1,
|
||||
:fill=>[@SystemHighlightText, ['selected'], '#FF5800', []])
|
||||
|
||||
if (TkPackage.vcompare(Tk::TreeCtrl.package_version, '1.1') >= 0)
|
||||
if $Version_1_1_OrLater
|
||||
s = t.style_create('styCheck')
|
||||
t.style_elements(s, ['border', 'imgCheck'])
|
||||
t.style_layout(s, 'border', :detach=>true, :iexpand=>:es)
|
||||
|
@ -112,7 +112,7 @@ def demoMailWasher(t)
|
|||
status = ['styNormal','styPossSpam','styProbSpam','styBlacklist'][rand(4)]
|
||||
attachments = ['styNone','styYes'][rand(2)]
|
||||
|
||||
if (TkPackage.vcompare(Tk::TreeCtrl.package_version, '1.1') >= 0)
|
||||
if $Version_1_1_OrLater
|
||||
delete = [false, true][rand(2)]
|
||||
bounce = [false, true][rand(2)]
|
||||
t.item_style_set(item,
|
||||
|
@ -197,7 +197,7 @@ def demoMailWasher(t)
|
|||
|
||||
mailWasher = TkBindTag.new
|
||||
|
||||
if (TkPackage.vcompare(Tk::TreeCtrl.package_version, '1.1') >= 0)
|
||||
if $Version_1_1_OrLater
|
||||
mailWasher.bind('ButtonPress-1',
|
||||
proc{|w, x, y|
|
||||
id = w.identify(x, y)
|
||||
|
@ -241,7 +241,7 @@ def demoMailWasher(t)
|
|||
t.bindtags = [t, mailWasher, Tk::TreeCtrl, t.winfo_toplevel, TkBindTag::ALL]
|
||||
end
|
||||
|
||||
if (TkPackage.vcompare(Tk::TreeCtrl.package_version, '1.1') >= 0)
|
||||
if $Version_1_1_OrLater
|
||||
def compareOnOff(w, c, item1, item2)
|
||||
s1 = w.item_state_forcolumn(item1, c)
|
||||
s2 = w.item_state_forcolumn(item2, c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue