Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit67fd2de

Browse files
committed
update tmtest.py for BTextView run_array tests
1 parent90889c7 commit67fd2de

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

‎tmtest.py‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,10 @@ def __init__(self):
316316
stuff='\n\t\t\t\t\t\tHello Haiku!\n\n\t\t\t\t\t\t\t\tA simple test program\n\t\t\t\t\t\t\t\tfor Haiku, version 1.0\n\t\t\t\t\t\t\t\tsample code included!\n\n\t\t\t\t\t\t\t\tby Fabio Tomat aka TmTFx\n\t\t\t\t\t\t\t\tand others\n\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\tspecial thanks to:\n\t\t\t\t\t\t\t\tZardshard and coolcoder613'
317317
#n = stuff.find('Bulletin Gator')
318318
#m = stuff.find('This')
319-
self.typtap.SetText(stuff,None)#, [(0, be_plain_font, (0, 0, 0, 0)), (n, be_bold_font, (0, 150, 0, 0)), (n + 14, be_plain_font, (0, 0, 0, 0)),(m,be_plain_font,(100,150,0,0))])
319+
#self.typtap.SetText(stuff,None)#, [(0, be_plain_font, (0, 0, 0, 0)), (n, be_bold_font, (0, 150, 0, 0)), (n + 14, be_plain_font, (0, 0, 0, 0)),(m,be_plain_font,(100,150,0,0))])
320320
self.AddChild(self.bckgnd,None)
321-
tra=self.typtap.RunArray(0,len(self.typtap.Text()))
322321
self.panel.AddChild(self.list.topview(),None)
322+
##self.tra=self.typtap.RunArray(0,len(self.typtap.Text()))
323323
pittura=rgb_color()
324324
pittura.red=255
325325
pittura.green=0
@@ -340,14 +340,18 @@ def __init__(self):
340340
tr2.font=BFont(be_bold_font)
341341
tr2.color=pictura
342342
mytralist=[tr1,tr2]
343-
tra.count=2#now you have 2 text_runs
344-
tra.runs[1]=tr2#assign the second one
345-
self.typtap.SetRunArray(0,len(self.typtap.Text()),tra)#this doesn't work
346-
trb=text_run_array()
347-
trb.count=2
348-
trb.runs=mytralist
349-
self.typtap.SetRunArray(0,len(self.typtap.Text()),trb)#this works, why error exiting and why does trb need tra (or it won't work)
343+
##tra.count=2 #now you have 2 text_runs
344+
##tra.runs[1] = tr2 #assign the second one
345+
##print("tra runs modified",tra.runs)
346+
##self.typtap.SetRunArray(0,len(self.typtap.Text()),tra) #this doesn't work
347+
self.trb=text_run_array()
348+
#trb=self.typtap.RunArray(0,len(self.typtap.Text()))#this crashes
349+
self.trb.count=2
350+
self.trb.runs=mytralist
351+
self.typtap.SetText(stuff,self.trb)
352+
#self.typtap.SetRunArray(0,len(self.typtap.Text()),trb) #this works, why error exiting and why does trb need tra (or it won't work)
350353
#print(tra.runs[1].color.green)
354+
#self.typtap.SetText(stuff,trb)
351355
###################### add other text_runs
352356
###### Example handling refs / BEntry #####
353357
a=entry_ref()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp