@@ -320,10 +320,11 @@ def CreatePageHighlight(self):
320320 ('#to choose items' ,'comment' ),('\n ' ,'normal' ),('def' ,'keyword' ),
321321 (' ' ,'normal' ),('func' ,'definition' ),('(param):' ,'normal' ),
322322 ('\n ' ,'normal' ),('"""string"""' ,'string' ),('\n var0 = ' ,'normal' ),
323- ("'string'" ,'string' ),('\n var1 = ' ,'normal' ),("'selected'" ,'selected' ),('\n var2 = ' ,'normal' ),
324- ("'found'" ,'found' ),('\n \n ' ,'normal' ),(' error ' ,'error' ),
325- ('cursor |' ,'cursor' ),('\n ' ,'normal' ),('shell' ,'shfg' ),(' ' ,'normal' ),('stdout' ,'shstdout' ),(' ' ,'normal' ),
326- ('stderr' ,'shstderr' ))
323+ ("'string'" ,'string' ),('\n var1 = ' ,'normal' ),("'selected'" ,'selected' ),
324+ ('\n var2 = ' ,'normal' ),("'found'" ,'found' ),('\n \n ' ,'normal' ),
325+ (' error ' ,'error' ),(' ' ,'normal' ),('cursor |' ,'cursor' ),
326+ ('\n ' ,'normal' ),('shell' ,'shfg' ),(' ' ,'normal' ),('stdout' ,'shstdout' ),
327+ (' ' ,'normal' ),('stderr' ,'shstderr' ),('\n ' ,'normal' ))
327328 for txTa in textAndTags :
328329 text .insert (END ,txTa [0 ],txTa [1 ])
329330 for element in self .themeElements .keys ():
@@ -535,8 +536,36 @@ def CreatePageGeneral(self):
535536 return frame
536537
537538 def PaintThemeSample (self ):
538- pass
539-
539+ if self .themeBuiltin .get : #a default theme
540+ theme = self .builtinTheme .get ()
541+ else : #a user theme
542+ theme = self .customTheme .get ()
543+ colours = idleConf .GetHighlight (theme , 'normal' )
544+ #normalBg=colours['background']
545+ apply (self .textHighlightSample .tag_config ,('normal' ,),colours )
546+ colours = idleConf .GetHighlight (theme , 'keyword' )
547+ apply (self .textHighlightSample .tag_config ,('keyword' ,),colours )
548+ colours = idleConf .GetHighlight (theme , 'comment' )
549+ apply (self .textHighlightSample .tag_config ,('comment' ,),colours )
550+ colours = idleConf .GetHighlight (theme , 'definition' )
551+ apply (self .textHighlightSample .tag_config ,('definition' ,),colours )
552+ colours = idleConf .GetHighlight (theme , 'string' )
553+ apply (self .textHighlightSample .tag_config ,('string' ,),colours )
554+ colours = idleConf .GetHighlight (theme , 'hilite' )
555+ apply (self .textHighlightSample .tag_config ,('selected' ,),colours )
556+ colours = idleConf .GetHighlight (theme , 'hit' )
557+ apply (self .textHighlightSample .tag_config ,('found' ,),colours )
558+ colours = idleConf .GetHighlight (theme , 'cursor' )
559+ apply (self .textHighlightSample .tag_config ,('cursor' ,),colours )
560+ colours = idleConf .GetHighlight (theme , 'error' )
561+ apply (self .textHighlightSample .tag_config ,('error' ,),colours )
562+ colours = idleConf .GetHighlight (theme , 'console' )
563+ apply (self .textHighlightSample .tag_config ,('shfg' ,),colours )
564+ colours = idleConf .GetHighlight (theme , 'stdout' )
565+ apply (self .textHighlightSample .tag_config ,('shstdout' ,),colours )
566+ colours = idleConf .GetHighlight (theme , 'stderr' )
567+ apply (self .textHighlightSample .tag_config ,('shstderr' ,),colours )
568+
540569 def LoadFontCfg (self ):
541570 ##base editor font selection list
542571 fonts = list (tkFont .families (self ))
0 commit comments