Bwidget Source Code
Check-in [3ee805ef99]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:BWidget NoteBook - possibility to add an image at the right of each tab - ticket [15e19fe9ec]
Timelines: family | ancestors | descendants | both | bwidget
Files: files | file ages | folders
SHA3-256: 3ee805ef99853784be3aa5f8ea70c1435444e3205807c3b7be610dabbb6ccb12
User & Date: oehhar 2017-11-03 12:03:37
References
2017-11-03
12:53 Closed ticket [15e19fe9ec]: BWidget NoteBook - add an image at the right of each tab plus 8 other changes artifact: 48aaa8f5b6 user: oehhar
Context
2018-01-09
17:54
Merge fontchooser extensions: hex entry/display, help, title frames, user choice callback. Ticket [75101bf5ce] check-in: 5f374d671e user: oehhar tags: bwidget
2017-11-03
12:03
BWidget NoteBook - possibility to add an image at the right of each tab - ticket [15e19fe9ec] check-in: 3ee805ef99 user: oehhar tags: bwidget
2017-08-25
07:15
Tagged version 1.9.11 check-in: 02881ab4fd user: oehhar tags: bwidget, bwidget-1-9-11
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to BWman/NoteBook.html.

    42     42   <DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0>
    43     43   <TR>
    44     44   <TD>&nbsp;&nbsp;<A HREF="#-arcradius">-arcradius</A></TD>
    45     45   <TD>&nbsp;&nbsp;<A HREF="#-height">-height</A></TD>
    46     46   </TR>
    47     47   <TR>
    48     48   <TD>&nbsp;&nbsp;<A HREF="#-homogeneous">-homogeneous</A></TD>
    49         -<TD>&nbsp;&nbsp;<A HREF="#-side">-side</A></TD>
           49  +<TD>&nbsp;&nbsp;<A HREF="#-internalborderwidth">-internalborderwidth or -ibd</A></TD>
    50     50   </TR>
    51     51   <TR>
           52  +<TD>&nbsp;&nbsp;<A HREF="#-side">-side</A></TD>
    52     53   <TD>&nbsp;&nbsp;<A HREF="#-tabbevelsize">-tabbevelsize</A></TD>
    53         -<TD>&nbsp;&nbsp;<A HREF="#-tabpady">-tabpady</A></TD>
    54     54   </TR>
    55     55   <TR>
           56  +<TD>&nbsp;&nbsp;<A HREF="#-tabpady">-tabpady</A></TD>
    56     57   <TD>&nbsp;&nbsp;<A HREF="#-width">-width</A></TD>
    57     58   </TR>
    58     59   </TABLE></DD>
    59     60   </DL>
    60     61   <DL>
    61     62   <DT><I><A HREF="#wc">WIDGET COMMAND</A></I></DT>
    62     63   <DD><I>pathName</I> <A HREF="#bindtabs"><B>bindtabs</B></A>
................................................................................
   113    114    <I>page</I>
   114    115   </DD>
   115    116   </DL>
   116    117   <BR><HR WIDTH="100%"><BR>
   117    118   <B><A NAME="descr"></A>DESCRIPTION</B><BR>
   118    119   <P>
   119    120   
   120         -NoteBook widget manage a set of pages and displays one of them.
          121  +The NoteBook widget manages a set of pages and displays one of them.  A page
          122  +is a <B>frame</B> or <B>ttk::frame</B> that is included in the NoteBook by its
          123  +<A HREF="#insert"><B>insert</B></A> command.  Each page is associated with a tab;
          124  +the tabs are displayed in a band either above or below the pages, depending on
          125  +the value of the option <A HREF="#-side">-side</A>.
   121    126   
   122    127   </P>
   123    128   <BR><HR WIDTH="50%"><BR>
   124    129   <B><A NAME="wso">WIDGET-SPECIFIC OPTIONS</A></B><BR>
   125    130   <DL><DT><A NAME="-arcradius"><B>-arcradius</B></A></DT>
   126    131   <DD>
   127    132   
................................................................................
   138    143   In this case, user may want to call NoteBook::<B>compute_size</B> to make NoteBook larger
   139    144   enough to contains the largest page.
   140    145   </DD>
   141    146   </DL>
   142    147   <DL><DT><A NAME="-homogeneous"><B>-homogeneous</B></A></DT>
   143    148   <DD>
   144    149   
   145         -Specifies wether or not the label of the pages must have the same width.
          150  +Specifies whether or not the label of the pages must have the same width.
   146    151   
   147    152   </DD>
   148    153   </DL>
          154  +
          155  +<DL><DT><A NAME="-internalborderwidth"><B>-internalborderwidth</B> or <B>-ibd</B></A></DT>
          156  +<DD>
          157  +
          158  +Value that is applied to each page in the NoteBook as its <B>-borderwidth</B> or <B>-bd</B>.
          159  +
          160  +</DD>
          161  +</DL>
          162  +
          163  +
   149    164   <DL><DT><A NAME="-side"><B>-side</B></A></DT>
   150    165   <DD>
   151    166   
   152    167   Specifies the side where to place the label of the pages. Must be one
   153    168   of <B>top</B> or <B>bottom</B>.
   154    169   
   155    170   </DD>
................................................................................
   247    262   </DD></DL>
   248    263   <DL><DT><A NAME="insert"><I>pathName</I> <B>insert</B></A>
   249    264    <I>index</I>
   250    265    <I>page</I>
   251    266    ?<I>option value...</I>?
   252    267   </DT><DD>
   253    268   
   254         -Insert a new page idendified by <I>page</I> at position <I>index</I> in the pages list.
          269  +Insert a new page identified by <I>page</I> at position <I>index</I> in the pages list.
   255    270   <I>index</I> must be numeric or <B>end</B>. The pathname of the new page is returned.
          271  +Dynamic help, if it is specified by the options, is
          272  +displayed when the pointer hovers over the tab that belongs to the page.
   256    273   
   257    274   <P>
          275  +<DL><DT><A NAME="Page-activebackground"><B>-activebackground</B></A></DT>
          276  +<DD>
          277  +
          278  +Background color for the tab when it is active.
          279  +
          280  +</DD>
          281  +</DL>
          282  +<DL><DT><A NAME="Page-activeforeground"><B>-activeforeground</B></A></DT>
          283  +<DD>
          284  +
          285  +Color used for the tab's text when the tab is active.
          286  +
          287  +</DD>
          288  +</DL>
          289  +<DL><DT><A NAME="Page-background"><B>-background</B></A></DT>
          290  +<DD>
          291  +
          292  +Background color for the tab when it is not active.
          293  +
          294  +</DD>
          295  +</DL>
   258    296   <DL><DT><A NAME="Page-createcmd"><B>-createcmd</B></A></DT>
   259    297   <DD>
   260    298   
   261    299   Specifies a command to be called the first time the page is raised.
   262    300   
          301  +</DD>
          302  +</DL>
          303  +<DL><DT><A NAME="Page-disabledforeground"><B>-disabledforeground</B></A></DT>
          304  +<DD>
          305  +
          306  +Color used for the tab's text when the tab is disabled.
          307  +
          308  +</DD>
          309  +</DL>
          310  +
          311  +<DL><DT><A NAME="Page-foreground"><B>-foreground</B></A></DT>
          312  +<DD>
          313  +
          314  +Color used for the tab's text when the tab is neither active nor disabled.
          315  +
          316  +</DD>
          317  +</DL>
          318  +<DL><DT><A NAME="Page-helpcmd"><B>-helpcmd</B></A></DT>
          319  +<DD>
          320  +
          321  +Has no effect.
          322  +See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
          323  +
          324  +</DD>
          325  +</DL>
          326  +<DL><DT><A NAME="Page-helptext"><B>-helptext</B></A></DT>
          327  +<DD>
          328  +
          329  +Text for dynamic help. If empty, no help is available for this page.
          330  +See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
          331  +
          332  +</DD>
          333  +</DL>
          334  +<DL><DT><A NAME="Page-helptype"><B>-helptype</B></A></DT>
          335  +<DD>
          336  +
          337  +Type of dynamic help. Use <I>balloon</I> (the default for a NoteBook
          338  +page) or <I>variable</I>.
          339  +See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
          340  +
          341  +</DD>
          342  +</DL>
          343  +<DL><DT><A NAME="Page-helpvar"><B>-helpvar</B></A></DT>
          344  +<DD>
          345  +
          346  +Variable to use when <B>-helptype</B> option is <I>variable</I>.
          347  +See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
          348  +
   263    349   </DD>
   264    350   </DL>
   265    351   <DL><DT><A NAME="Page-image"><B>-image</B></A></DT>
   266    352   <DD>
   267    353   
   268    354   Specifies an image to display for the page at the left of the label
   269    355   
................................................................................
   271    357   </DL>
   272    358   <DL><DT><A NAME="Page-leavecmd"><B>-leavecmd</B></A></DT>
   273    359   <DD>
   274    360   
   275    361   Specifies a command to be called when a page is about to be leaved.
   276    362   The command must return 0 if the page can not be leaved, or 1 if it can.
   277    363   
          364  +</DD>
          365  +</DL>
          366  +<DL><DT><A NAME="Page-ractiveimage"><B>-ractiveimage</B></A></DT>
          367  +<DD>
          368  +
          369  +Image to show on the right of the tab when the tab is active.
          370  +
   278    371   </DD>
   279    372   </DL>
   280    373   <DL><DT><A NAME="Page-raisecmd"><B>-raisecmd</B></A></DT>
   281    374   <DD>
   282    375   
   283    376   Specifies a command to be called each time the page is raised.
   284    377   
          378  +</DD>
          379  +</DL>
          380  +<DL><DT><A NAME="Page-rimage"><B>-rimage</B></A></DT>
          381  +<DD>
          382  +
          383  +Image to show on the right of the tab when the tab is not active.
          384  +
          385  +</DD>
          386  +</DL>
          387  +<DL><DT><A NAME="Page-rimagecmd"><B>-rimagecmd</B></A></DT>
          388  +<DD>
          389  +
          390  +Specifies a command to be evaluated, with two arguments appended, when the
          391  +image shown on the right of the tab is clicked.  The first appended argument
          392  +is the Tk window path of the NoteBook, the second is the name of the page.
          393  +
   285    394   </DD>
   286    395   </DL>
   287    396   <DL><DT><A NAME="Page-state"><B>-state</B></A></DT>
   288    397   <DD>
   289    398   
   290    399   Specifies the state of the page. Must be <B>normal</B> or <B>disabled</B>.
   291    400   

Changes to ChangeLog.

            1  +2017-11-03 Harald Oehlmann
            2  +	notebook.tcl (+man,demo): Add possibility to NoteBook
            3  +	to add an image at the right of each tab.
            4  +	Ticket [15e19fe9ec]. Patch by Keith Nash.
            5  +
     1      6   2017-08-25 Harald Oehlmann <[email protected]>
     2      7   
     3      8   	**** BWidget 1.9.11 tagged ****
     4      9   
     5     10   2017-05-08 Harald Oehlmann
     6     11   	MessageDlg.html: Documented the use of the native widget for
     7     12   	"MessageDlg -type !user" and the limited set of recognized

Changes to demo/demo.tcl.

    23     23       foreach script {
    24     24   	manager.tcl basic.tcl select.tcl dnd.tcl tree.tcl tmpldlg.tcl
    25     25       } {
    26     26   	namespace inscope :: source $DEMODIR/$script
    27     27       }
    28     28   }
    29     29   
           30  +image create photo bwidget16 -data {
           31  +    R0lGODlhEAAQAOMJABat6IGYffaBCUSku/KCDcCMPomXdgCy//+AANnZ2dnZ2dnZ2dnZ2dnZ2dnZ
           32  +    2dnZ2SH5BAEKAA8ALAAAAAAQABAAAAQ58MlJq70U6a0x/9c2iRb5mNmHjmpXuiecIpRA0JWJDEfw
           33  +    HIffoWU4AIBBYKuABAoxSGEQ6oxins8IADs=
           34  +}
           35  +
           36  +image create photo faded16 -data {
           37  +    R0lGODlhEAAQAKEDAAAAAICAgKCgoP///yH5BAEKAAMALAAAAAAQABAAAAIjnI+py+1vQEABsDoH
           38  +    blUI+XyAAImk033Zsmng8hoVRNd2XQAAOw==
           39  +}
           40  +
           41  +image create photo stop16 -data {
           42  +    R0lGODlhEAAQAMIFAAAAAC8DA3gKCpYMDPAUFP///////////yH5BAEKAAcALAAAAAAQABAAAAMm
           43  +    SLrc/jDKqYBgAsB8CY/ZMFjTGAzUEACoFI7d83nkUysZpe/8ngAAOw==
           44  +}
    30     45   
    31     46   proc Demo::create { } {
    32     47       global   tk_patchLevel
    33     48       variable _wfont
    34     49       variable notebook
    35     50       variable mainframe
    36     51       variable font
................................................................................
   129    144       set f3b [DemoDlg::create $notebook]
   130    145       set prgtext   "Creating Drag and Drop..."
   131    146       incr prgindic
   132    147       set f4 [DemoDnd::create $notebook]
   133    148       set prgtext   "Creating Tree..."
   134    149       incr prgindic
   135    150       set f5 [DemoTree::create $notebook]
          151  +
          152  +    foreach page [$notebook pages] {
          153  +        $notebook itemconfigure $page \
          154  +                -image        bwidget16 \
          155  +                -rimage       faded16 \
          156  +                -ractiveimage stop16  \
          157  +                -rimagecmd    {::Demo::_close_tab}
          158  +    }
   136    159   
   137    160       set prgtext   "Done"
   138    161       incr prgindic
   139    162       $notebook compute_size
   140    163       pack $notebook -fill both -expand yes -padx 4 -pady 4
   141    164       $notebook raise [$notebook page 0]
   142    165   
   143    166       pack $mainframe -fill both -expand yes
   144    167       update idletasks
   145    168       destroy .intro
   146    169   }
          170  +
          171  +proc Demo::_close_tab { tabSet tabName } {
          172  +    after idle [list $tabSet delete $tabName]
          173  +
          174  +    set tabIndex [$tabSet index $tabName]
          175  +    set tabList  [$tabSet pages]
          176  +    set tabTot   [llength $tabList]
          177  +
          178  +    # Pick another tab to raise.
          179  +    if {$tabTot == 1} {
          180  +        # No other tabs.
          181  +        exit
          182  +    } elseif {$tabIndex < $tabTot - 1} {
          183  +        # Raise the tab to the right.
          184  +        set raiseTabName [lindex $tabList [expr {$tabIndex + 1}]]
          185  +    } else {
          186  +        # This tab is furthest to the right. Raise the tab to the left.
          187  +        set raiseTabName [lindex $tabList [expr {$tabIndex - 1}]]
          188  +    }
          189  +
          190  +    $tabSet raise $raiseTabName
          191  +    $tabSet see   $raiseTabName
          192  +    return
          193  +}
          194  +
   147    195   
   148    196   
   149    197   proc Demo::update_font { newfont } {
   150    198       variable _wfont
   151    199       variable notebook
   152    200       variable font
   153    201       variable font_name

Changes to notebook.tcl.

    39     39       namespace eval Page {
    40     40           Widget::declare NoteBook::Page {
    41     41               {-state      Enum       normal 0 {normal disabled}}
    42     42               {-createcmd  String     ""     0}
    43     43               {-raisecmd   String     ""     0}
    44     44               {-leavecmd   String     ""     0}
    45     45               {-image      TkResource ""     0 label}
           46  +            {-rimage     String     ""     0}
           47  +            {-ractiveimage String   ""     0}
           48  +            {-rimagecmd  String     ""     0}
    46     49               {-text       String     ""     0}
    47     50               {-foreground         String     ""     0}
    48     51               {-background         String     ""     0}
    49     52               {-activeforeground   String     ""     0}
    50     53               {-activebackground   String     ""     0}
    51     54               {-disabledforeground String     ""     0}
    52     55           }
................................................................................
   270    273           } else {
   271    274               frame $f \
   272    275                   -relief      flat \
   273    276                   -background  [Widget::cget $path -background] \
   274    277                   -borderwidth [Widget::cget $path -internalborderwidth]
   275    278           }
   276    279           set data($page,realized) 0
          280  +        set data($page,rimage)   0
   277    281       } else {
   278    282           if { ! $::Widget::_theme} {
   279    283               $f configure -background  [Widget::cget $path -background]
   280    284           }
   281    285           $f configure -borderwidth [Widget::cget $path -internalborderwidth]
   282    286       }
   283    287       _compute_height $path
................................................................................
   305    309           set data(select) ""
   306    310       }
   307    311       if { $pos < $data(base) } {
   308    312           incr data(base) -1
   309    313       }
   310    314       if { $destroyframe } {
   311    315           destroy $path.f$page
   312         -        unset data($page,width) data($page,realized)
          316  +        unset data($page,width) data($page,realized) data($page,rimage)
   313    317       }
   314    318       _redraw $path
   315    319   }
   316    320   
   317    321   
   318    322   # ---------------------------------------------------------------------------
   319    323   #  Command NoteBook::itemconfigure
................................................................................
   502    506   
   503    507       set res [Widget::configure $path.f$page $lres]
   504    508       if { [Widget::hasChanged $path.f$page -text foo] } {
   505    509           _compute_width $path
   506    510       } elseif  { [Widget::hasChanged $path.f$page -image foo] } {
   507    511           _compute_height $path
   508    512           _compute_width  $path
          513  +    } elseif  { [Widget::hasChanged $path.f$page -rimage foo] } {
          514  +        _compute_height $path
          515  +        _compute_width  $path
   509    516       }
   510    517       if { [Widget::hasChanged $path.f$page -state state] &&
   511    518            $state == "disabled" && $data(select) == $page } {
   512    519           set data(select) ""
   513    520       }
   514    521       _set_help $path $page
   515    522       return $res
................................................................................
   542    549           set wtext [expr {$x2 - $x1 + 20}]
   543    550           if { [set img [Widget::cget $path.f$page -image]] != "" } {
   544    551               set wtext [expr {$wtext + [image width $img] + 4}]
   545    552               set himg  [expr {[image height $img] + 6}]
   546    553               if { $himg > $hmax } {
   547    554                   set hmax $himg
   548    555               }
          556  +        }
          557  +        if { [set jmg [Widget::cget $path.f$page -rimage]] != "" } {
          558  +            set wtext [expr {$wtext + [image width $jmg] + 4}]
          559  +            set hjmg  [expr {[image height $jmg] + 6}]
          560  +            if { $hjmg > $hmax } {
          561  +                set hmax $hjmg
          562  +            }
   549    563           }
   550    564           set  wmax  [expr {$wtext > $wmax ? $wtext : $wmax}]
   551    565           incr wtot  $wtext
   552    566           set  data($page,width) $wtext
   553    567       }
   554    568       if { [Widget::cget $path -homogeneous] } {
   555    569           foreach page $data(pages) {
................................................................................
   570    584       upvar 0  $path data
   571    585   
   572    586       set font    [Widget::cget $path -font]
   573    587       set pady0   [Widget::_get_padding $path -tabpady 0]
   574    588       set pady1   [Widget::_get_padding $path -tabpady 1]
   575    589       set metrics [font metrics $font -linespace]
   576    590       set imgh    0
          591  +    set jmgh    0
   577    592       set lines   1
   578    593       foreach page $data(pages) {
   579    594           set img  [Widget::cget $path.f$page -image]
          595  +        set jmg  [Widget::cget $path.f$page -rimage]
   580    596           set text [Widget::cget $path.f$page -text]
   581    597           set len [llength [split $text \n]]
   582    598           if {$len > $lines} { set lines $len}
   583    599           if {$img != ""} {
   584    600               set h [image height $img]
   585    601               if {$h > $imgh} { set imgh $h }
   586    602           }
          603  +        if {$jmg != ""} {
          604  +            set h [image height $jmg]
          605  +            if {$h > $jmgh} { set jmgh $h }
          606  +        }
   587    607       }
   588    608       set height [expr {$metrics * $lines}]
   589    609       if {$imgh > $height} { set height $imgh }
          610  +    if {$jmgh > $height} { set height $jmgh }
   590    611       set data(hpage) [expr {$height + $pady0 + $pady1}]
   591    612   }
   592    613   
   593    614   
   594    615   # ---------------------------------------------------------------------------
   595    616   #  Command NoteBook::_get_x_page
   596    617   # ---------------------------------------------------------------------------
................................................................................
   662    683   		    -fill [_getoption $path $page -background]
   663    684               $path.c itemconfigure "$page:text" \
   664    685   		    -fill [_getoption $path $page -foreground]
   665    686           }
   666    687       }
   667    688   }
   668    689   
          690  +
          691  +# ---------------------------------------------------------------------------
          692  +#  Command NoteBook::_rightImage
          693  +# ---------------------------------------------------------------------------
          694  +proc NoteBook::_rightImage { type path page } {
          695  +    variable $path
          696  +    upvar 0  $path data
          697  +
          698  +    if { [string equal [Widget::cget $path.f$page -state] "disabled"] } {
          699  +        return
          700  +    }
          701  +
          702  +    switch -- $type {
          703  +        on {
          704  +            set data($page,rimage) 1
          705  +            set jmg  [Widget::cget $path.f$page -rimage]
          706  +            set jamg [Widget::cget $path.f$page -ractiveimage]
          707  +            if {    ($jmg  ne {})
          708  +                 && ($jamg ne {})
          709  +                 && ([image height $jmg] == [image height $jamg])
          710  +                 && ([image width  $jmg] == [image width  $jamg])
          711  +            } {
          712  +            $path.c itemconfigure "$page:jmg" \
          713  +		    -image $jamg
          714  +            } else {
          715  +                # Don't replace the -rimage with the -raimage if they are
          716  +                # different sizes.
          717  +            }
          718  +        }
          719  +        off {
          720  +            set data($page,rimage) 0
          721  +            $path.c itemconfigure "$page:jmg" \
          722  +		    -image [Widget::cget $path.f$page -rimage]
          723  +        }
          724  +        command {
          725  +	    set cmd [Widget::cget $path.f$page -rimagecmd]
          726  +	    if {$cmd ne {}} {
          727  +		after idle [list uplevel #0 [list NoteBook::_rightImage execute $path $page]]
          728  +		# Call after idle so that, if the pointer has left the -rimage,
          729  +		# the <Leave> event fires and resets data($page,rimage) before
          730  +		# NoteBook::_rightImage execute is evaluated.
          731  +	    }
          732  +        }
          733  +        execute {
          734  +	    set cmd [Widget::cget $path.f$page -rimagecmd]
          735  +	    if {$cmd ne {} && $data($page,rimage)} {
          736  +		uplevel #0 [concat $cmd [list $path $page]]
          737  +	    }
          738  +        }
          739  +    }
          740  +}
          741  +
   669    742   
   670    743   # ---------------------------------------------------------------------------
   671    744   #  Command NoteBook::_select
   672    745   # ---------------------------------------------------------------------------
   673    746   proc NoteBook::_select { path page } {
   674    747       variable $path
   675    748       upvar 0  $path data
................................................................................
   834    907   		[expr {$xf + 1 - $xBevel}] 		[expr {$top + 1}] \
   835    908   		[expr {$rightPlusRadius - $xBevel}]	$topPlusRadius \
   836    909   		$rightPlusRadius			$h \
   837    910   		]
   838    911       }
   839    912   
   840    913       set img [Widget::cget $path.f$page -image]
          914  +    set jmg [Widget::cget $path.f$page -rimage]
   841    915   
   842    916       set ytext $top
   843    917       if { $tabsOnBottom } {
   844    918   	# The "+ 2" below moves the text closer to the bottom of the tab,
   845    919   	# so it doesn't look so cramped.  I should be able to achieve the
   846    920   	# same goal by changing the anchor of the text and using this formula:
   847    921   	# ytext = $top + $h1 - $textOffsetY
................................................................................
   853    927   
   854    928       set xtext [expr {$xd + $textOffsetX}]
   855    929       if { $img != "" } {
   856    930   	# if there's an image, put it on the left and move the text right
   857    931   	set ximg $xtext
   858    932   	incr xtext [expr {[image width $img] + 2}]
   859    933       }
          934  +
          935  +    if { $jmg != "" } {
          936  +	# if there's an image, put it on the right and leave the text
          937  +	set xjmg $xtext
          938  +	if { $img != "" } {
          939  +	    set xjmg $ximg
          940  +	}
          941  +	incr xjmg [expr {$data($page,width) - [image width $jmg] - 10}]
          942  +    }
   860    943   	
   861    944       if { $data(select) == $page } {
   862    945           set bd    [Widget::cget $path -borderwidth]
   863    946   	if {$bd < 1} { set bd 1 }
   864    947           set fg    [_getoption $path $page -foreground]
   865    948       } else {
   866    949           set bd    1
................................................................................
   924   1007           }
   925   1008           $path.c coords $id $ximg $ytext
   926   1009           $path.c itemconfigure $id -image $img
   927   1010           # Sven end
   928   1011       } else {
   929   1012           $path.c delete $page:img
   930   1013       }
         1014  +
         1015  +    if { $jmg != "" } {
         1016  +	set id [$path.c find withtag $page:jmg]
         1017  +	if { [string equal $id ""] } {
         1018  +	    set id [$path.c create image $xjmg $ytext \
         1019  +		    -anchor nw    \
         1020  +		    -tags   [list page p:$page $page:jmg]]
         1021  +        }
         1022  +        $path.c coords $id $xjmg $ytext
         1023  +        $path.c itemconfigure $id -image $jmg
         1024  +
         1025  +        $path.c bind $page:jmg <Enter> \
         1026  +		[list NoteBook::_rightImage on  $path $page]
         1027  +        $path.c bind $page:jmg <Leave> \
         1028  +		[list NoteBook::_rightImage off $path $page]
         1029  +        $path.c bind $page:jmg <ButtonRelease-1> \
         1030  +		[list NoteBook::_rightImage command $path $page]
         1031  +    } else {
         1032  +        $path.c delete $page:jmg
         1033  +    }
   931   1034   
   932   1035       if { $data(select) == $page } {
   933   1036           $path.c raise p:$page
   934   1037       } elseif { $pos == 0 } {
   935   1038           if { $data(select) == "" } {
   936   1039               $path.c raise p:$page
   937   1040           } else {