[PATCH] old Tk problems

From: Andrzej Krzysztofowicz (ankry@green.mif.pg.gda.pl)
Date: Tue May 30 2000 - 14:49:46 EST


Hi Alan,
      Unfortunately one of my previous xconfig patches broke
xconfig with old Tk (lacking "-title" option of the "menu" command).
      Here is a fix that makes xconfig (in 2.4.0test* and 2.2.16pre*)
usable again on old systems. Tested with Tk version >= 4.1.

Andrzej

*******************************************************************
--- scripts/header.tk.old Tue May 30 21:06:05 2000
+++ scripts/header.tk Tue May 30 21:07:32 2000
@@ -402,6 +402,7 @@
 
 proc menusplit {w m n} {
         if { $n > 2 } then {
+ update idletasks
                 set menuoptsize [expr [$m yposition 2] - [$m yposition 1]]
                 set maxsize [winfo screenheight $w]
                 set splitpoint [expr $maxsize * 4 / 5 / $menuoptsize - 1]
@@ -409,6 +410,10 @@
                         $m entryconfigure $i -columnbreak 1
                 }
         }
+}
+
+proc menutitle {text menu w} {
+ wm title $w "$text"
 }
 
 proc submenu { w mnum line text subnum } {
--- scripts/tkgen.c.old Tue May 30 21:08:44 2000
+++ scripts/tkgen.c Tue May 30 21:14:44 2000
@@ -1248,7 +1248,7 @@
                 printf( "\tminimenu $w.config.f %d %d \"%s\" tmpvar_%d %s\n",
                     cfg->menu_number, cfg->menu_line, cfg->label,
                     -(cfg->nameindex), vartable[cfg->next->nameindex].name );
- printf( "\tmenu $w.config.f.x%d.x.menu -title \"%s\"\n",
+ printf( "\tmenu $w.config.f.x%d.x.menu -tearoffcommand \"menutitle \\\"%s\\\"\"\n",
                     cfg->menu_line, cfg->label );
                 cfg1 = cfg;
                 opt_count = 0;
*******************************************************************

-- 
=======================================================================
  Andrzej M. Krzysztofowicz               ankry@mif.pg.gda.pl
  phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math.,   Technical University of Gdansk

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:25 EST