This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] library/managedwin.it{h,b} cleanup #1


I think it's confusing that you made protected variables and methods
prefixed by an underscore like private variables and functions.  This
doesn't seem to be the standard for the rest of the files.

If you do want to do this, you will need to fix the browser and kod
windows.  Here's the patch:

2001-03-01  Martin Hunt  <hunt@redhat.com>

	* library/browserwin.itb: Change all references to freeze_me,
	thaw_me and Top to _freeze_me, _thaw_me, and _top to match
	changes to managedwin.
	* library/kod.itb: Ditto.

Index: browserwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/browserwin.itb,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 browserwin.itb
*** browserwin.itb	2000/02/07 00:19:42	1.1.1.1
--- browserwin.itb	2001/03/02 05:57:31
***************
*** 1,5 ****
! # Browswer window for GDBtk.
! # Copyright 1998, 1999 Cygnus Solutions
  #
  # This program is free software; you can redistribute it and/or modify it
  # under the terms of the GNU General Public License (GPL) as published by
--- 1,5 ----
! # Browswer window for Insight.
! # Copyright 1998, 1999, 2001 Red Hat
  #
  # This program is free software; you can redistribute it and/or modify it
  # under the terms of the GNU General Public License (GPL) as published by
*************** body BrowserWin::search {} {
*** 426,432 ****
      return
    }

!   freeze_me

    set filt_pat [format $filter_regexp($cur_filter_mode) \
  		  [pref get gdb/search/last_symbol]]
--- 426,432 ----
      return
    }

!   _freeze_me

    set filt_pat [format $filter_regexp($cur_filter_mode) \
  		  [pref get gdb/search/last_symbol]]
*************** body BrowserWin::search {} {
*** 441,447 ****

    if {$err} {
      debug "ERROR searching for [pref get gdb/search/last_symbol]: $matches"
!     thaw_me
      return
    }

--- 441,447 ----

    if {$err} {
      debug "ERROR searching for [pref get gdb/search/last_symbol]: $matches"
!     _thaw_me
      return
    }

*************** body BrowserWin::search {} {
*** 454,460 ****
      $itk_component(func_box) insert end [lindex $func 0]
      set index_to_file([incr i]) [lindex $func 1]
    }
!   thaw_me
  }

  # ------------------------------------------------------------------
--- 454,460 ----
      $itk_component(func_box) insert end [lindex $func 0]
      set index_to_file([incr i]) [lindex $func 1]
    }
!   _thaw_me
  }

  # ------------------------------------------------------------------
*************** body BrowserWin::_toggle_more {{in_const
*** 467,474 ****
    # Temporarily disable the resize bindings before opening the window.
    _bind_toplevel 0

!   set topHeight [winfo height $Top]
!   set topWidth  [winfo width $Top]

    if {!$MoreVisible} {

--- 467,474 ----
    # Temporarily disable the resize bindings before opening the window.
    _bind_toplevel 0

!   set topHeight [winfo height $_top]
!   set topWidth  [winfo width $_top]

    if {!$MoreVisible} {

*************** body BrowserWin::_toggle_more {{in_const
*** 481,498 ****
      # screen.  Otherwise, figure out how big to make it...

      set height [pref get gdb/browser/view_height]
!     set bottom [expr {[winfo y $Top] + $topHeight}]

!     set extra [expr {[winfo screenheight $Top] - $bottom - 20}]

      if {$height < 0} {
!       set default [winfo pixels $Top 3i]
        set height [expr {$extra > $default ? $default : $extra}]
      } else {
        set height [expr {$extra > $height ? $height : $extra}]
      }

!     wm geometry $Top ${topWidth}x[expr {$topHeight + $height}]
      grid rowconfigure $itk_component(hull) $componentToRow(view_hidden) \
        -weight 1
      grid rowconfigure $itk_component(hull) $componentToRow(browser) -weight 0
--- 481,498 ----
      # screen.  Otherwise, figure out how big to make it...

      set height [pref get gdb/browser/view_height]
!     set bottom [expr {[winfo y $_top] + $topHeight}]

!     set extra [expr {[winfo screenheight $_top] - $bottom - 20}]

      if {$height < 0} {
!       set default [winfo pixels $_top 3i]
        set height [expr {$extra > $default ? $default : $extra}]
      } else {
        set height [expr {$extra > $height ? $height : $extra}]
      }

!     wm geometry $_top ${topWidth}x[expr {$topHeight + $height}]
      grid rowconfigure $itk_component(hull) $componentToRow(view_hidden) \
        -weight 1
      grid rowconfigure $itk_component(hull) $componentToRow(browser) -weight 0
*************** body BrowserWin::_toggle_more {{in_const
*** 542,548 ****

      set newTopHeight [expr {$topHeight - \
  			      [winfo height $itk_component(view_hidden)]}]
!     wm geometry $Top ${topWidth}x$newTopHeight

      if {!$in_constructor} {
        grid rowconfigure $itk_component(hull) $componentToRow(browser) -weight 1
--- 542,548 ----

      set newTopHeight [expr {$topHeight - \
  			      [winfo height $itk_component(view_hidden)]}]
!     wm geometry $_top ${topWidth}x$newTopHeight

      if {!$in_constructor} {
        grid rowconfigure $itk_component(hull) $componentToRow(browser) -weight 1
*************** body BrowserWin::_toggle_more {{in_const
*** 574,585 ****
  # ------------------------------------------------------------------
  body BrowserWin::_bind_toplevel {install} {

!   set bindings [bindtags $Top]
    if {$install} {
!     bindtags $Top [linsert $bindings 0 Configure_Browser_$this]
    } else {
      set bindLoc [lsearch $bindings Configure_Browser_$this]
!     bindtags $Top [lreplace $bindings $bindLoc $bindLoc]
    }
  }

--- 574,585 ----
  # ------------------------------------------------------------------
  body BrowserWin::_bind_toplevel {install} {

!   set bindings [bindtags $_top]
    if {$install} {
!     bindtags $_top [linsert $bindings 0 Configure_Browser_$this]
    } else {
      set bindLoc [lsearch $bindings Configure_Browser_$this]
!     bindtags $_top [lreplace $bindings $bindLoc $bindLoc]
    }
  }

*************** body BrowserWin::_do_resize {} {
*** 610,616 ****
    }

    eval $labelUpdateCode
!   pack propagate $Top 1

    set resize_after ""

--- 610,616 ----
    }

    eval $labelUpdateCode
!   pack propagate $_top 1

    set resize_after ""

*************** body BrowserWin::_do_resize {} {
*** 622,628 ****
  # ------------------------------------------------------------------
  body BrowserWin::_resize {} {

!   pack propagate $Top 0

    if {$MoreVisible} {
      grid rowconfigure $itk_component(hull) $componentToRow(view_hidden) \
--- 622,628 ----
  # ------------------------------------------------------------------
  body BrowserWin::_resize {} {

!   pack propagate $_top 0

    if {$MoreVisible} {
      grid rowconfigure $itk_component(hull) $componentToRow(view_hidden) \
*************** body BrowserWin::_process_func_selection
*** 697,703 ****
  body BrowserWin::do_all_bp {onp} {

    set funcs [$itk_component(func_box) getcurselection]
!   freeze_me

    foreach f $funcs {
      if {[catch {gdb_loc $f} linespec]} {
--- 697,703 ----
  body BrowserWin::do_all_bp {onp} {

    set funcs [$itk_component(func_box) getcurselection]
!   _freeze_me

    foreach f $funcs {
      if {[catch {gdb_loc $f} linespec]} {
*************** body BrowserWin::do_all_bp {onp} {
*** 715,721 ****
        catch {gdb_cmd "delete $bpnum"}
      }
    }
!   thaw_me
  }

  # ------------------------------------------------------------------
--- 715,721 ----
        catch {gdb_cmd "delete $bpnum"}
      }
    }
!   _thaw_me
  }

  # ------------------------------------------------------------------
*************** body BrowserWin::_fill_source {f {funcp
*** 810,823 ****
      if {$file_changed} {
        # Set the file name label:
        $itk_component(view_name) configure -text $name:
!       freeze_me
      }

      $itk_component(view_src) location BROWSE_TAG $name $funcname \
        $line $addr $pc_addr lib

      if {$file_changed} {
!       thaw_me
      }

      set Current(function) $funcname
--- 810,823 ----
      if {$file_changed} {
        # Set the file name label:
        $itk_component(view_name) configure -text $name:
!       _freeze_me
      }

      $itk_component(view_src) location BROWSE_TAG $name $funcname \
        $line $addr $pc_addr lib

      if {$file_changed} {
!       _thaw_me
      }

      set Current(function) $funcname
Index: kod.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/kod.itb,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 kod.itb
*** kod.itb	2000/02/07 00:19:42	1.1.1.1
--- kod.itb	2001/03/02 05:57:32
***************
*** 1,5 ****
! # Kernel Object Display Window for GDBtk.
! # Copyright (C) 1998, 1999 Cygnus Solutions
  #
  # This program is free software; you can redistribute it and/or modify it
  # under the terms of the GNU General Public License (GPL) as published by
--- 1,5 ----
! # Kernel Object Display Window for Insight.
! # Copyright (C) 1998, 1999, 2001 Red Hat
  #
  # This program is free software; you can redistribute it and/or modify it
  # under the terms of the GNU General Public License (GPL) as published by
*************** body KodWin::build_win {} {
*** 139,145 ****
    pack $tp.tf -side top -expand yes -fill both -padx 5 -pady 5
    pack $tp.bf -side top -expand no -fill x -padx 5 -pady 5
    pack $itk_interior.pw -side bottom -expand yes -fill both
!   wm minsize $Top 450 500

    # Initialize button state variables for idle (called before update)
    set BState(BDisplay) disabled
--- 139,145 ----
    pack $tp.tf -side top -expand yes -fill both -padx 5 -pady 5
    pack $tp.bf -side top -expand no -fill x -padx 5 -pady 5
    pack $itk_interior.pw -side bottom -expand yes -fill both
!   wm minsize $_top 450 500

    # Initialize button state variables for idle (called before update)
    set BState(BDisplay) disabled
*************** body KodWin::idle {} {
*** 453,459 ****
  #        pointer to the given glyph.
  # ------------------------------------------------------------------
  body KodWin::cursor {glyph} {
!   $Top configure -cursor $glyph
  }

  # ------------------------------------------------------------------
--- 453,459 ----
  #        pointer to the given glyph.
  # ------------------------------------------------------------------
  body KodWin::cursor {glyph} {
!   $_top configure -cursor $glyph
  }

  # ------------------------------------------------------------------

On Wed, 28 Feb 2001, Keith Seitz wrote:

> Hi,
>
> I am cleaning a little house on these files: updating copyrights,
> "masssaging" for readability, adding comments, removing dead code, etc.
>
> These changes are strictly non-functional changes which affect only these
> two files. Changes to be made to ManagedWin which affect other files to
> follow.
>
> Comments? (Yes, I have begun a Tcl programming style guide for Insight...)
> Keith
>
> ChangeLog:
> 2001-02-28  Keith Seitz  <keiths@cygnus.com>
>
> 	* library/managedwin.ith: Move all implementations into
> 	managedwin.itb.
> 	(public variable nosize): Delete.
> 	(freeze_me, thaw_me, make_icon_window): Prepend with
> 	underscore to remind people these are not public
> 	methods/procs.
> 	(protected variable Top, screenwidth, screenheight): Ditto
> 	for these variables.
> 	(protected common manage_active, mainwindow): Delete.
> 	(enable): Delete.
> 	(reconfig): Add empty body.
> 	* library/managedwin.itb: Move all implementations from
> 	header here.
> 	Update all references to renamed variables/methods/procs.
> 	(destructor, restart, shutdown, _open, find) Let
> 	Itcl tell us which ManagedWins we have lying around.
> 	(enable): Delete.
> 	(reconfig): It's empty. Moved empty body to header.
>
> Patch:
>
> Index: managedwin.ith
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtk/library/managedwin.ith,v
> retrieving revision 1.2
> diff -p -p -r1.2 managedwin.ith
> *** managedwin.ith	2000/03/28 01:59:40	1.2
> --- managedwin.ith	2001/03/01 03:11:16
> ***************
> *** 1,5 ****
>   # Managed window class definition for GDBtk.
> ! # Copyright 1998, 1999 Cygnus Solutions
>   #
>   # This program is free software; you can redistribute it and/or modify it
>   # under the terms of the GNU General Public License (GPL) as published by
> --- 1,5 ----
>   # Managed window class definition for GDBtk.
> ! # Copyright 1998, 1999, 2000, 2001 Red Hat, Inc.
>   #
>   # This program is free software; you can redistribute it and/or modify it
>   # under the terms of the GNU General Public License (GPL) as published by
> *************** class ManagedWin {
> *** 16,31 ****
>     inherit itk::Widget
>
>     public {
> !     method reconfig {}
>       method destroy_toplevel {}
>       method quit_if_last {} {return 1}
> -     method enable {on}
>       method pickle {}
>       method reveal {}
>       method window_name {wname {iname ""}}
>
> -     variable nosize 0
> -
>       proc find {win}
>       proc open {args}
>       proc open_dlg {class args}
> --- 16,31 ----
>     inherit itk::Widget
>
>     public {
> !     method constructor {args}
> !     method destructor {}
> !
> !     method reconfig {} {}
>       method destroy_toplevel {}
>       method quit_if_last {} {return 1}
>       method pickle {}
>       method reveal {}
>       method window_name {wname {iname ""}}
>
>       proc find {win}
>       proc open {args}
>       proc open_dlg {class args}
> *************** class ManagedWin {
> *** 35,105 ****
>       proc shutdown {}
>     }
>
> -   protected {
> -     proc dont_remember_size {} {
> -       return 0
> -     }
> -     method freeze_me {}
> -     method thaw_me {}
> -
> -     variable Top
> -   }
> -
> -   private {
> -     proc _create {class args}
> -     proc _open {class args}
> -     proc make_icon_window {name {file "gdbtk_icon"}}
> -   }
> -
>     protected {
> !     # manage_active - list of active window objects
> !     common manage_active ""
>
>       # this is the counter of TopLevelWins open
>       # when it hits 0, exit.
>       common numTopWins 0
>
> !     common screenwidth
> !     common screenheight
> !     common mainwindow
> !   }
> !
> !   constructor {args} {
> !     debug "$this args=$args"
> !     lappend manage_active $this
> !     set Top [winfo toplevel $itk_interior]
> !
> !   }
>
> !   destructor {
>
> !     set infoList [after info]
> !
> !     # remove object from list
> !     set i [lsearch -exact $manage_active $this]
> !     if {$i != -1} {
> !       set manage_active [lreplace $manage_active $i $i]
> !     }
> !
> !     # save geometry
> !     set g [wm geometry [winfo toplevel [namespace tail $this]]]
> !     pref setd gdb/geometry/[namespace tail $this] $g
> !
> !     # If no toplevels remain, quit.  However, check the quit_if_last
> !     # flag since we might be doing something like displaying a
> !     # splash screen at startup...
> !
> !     if {!$numTopWins && [quit_if_last]} {
> !       # save window positions of remaining windows
> !       foreach obj $manage_active {
> ! 	set g [wm geometry [winfo toplevel [namespace tail $obj]]]
> ! 	pref setd gdb/geometry/[namespace tail $obj] $g
> !       }
> !       pref_save
> !       gdb_force_quit
> !     } else {
> !       destroy_toplevel
> !     }
> !  }
>
>   }
> --- 35,60 ----
>       proc shutdown {}
>     }
>
>     protected {
> !     # The Tk's toplevel window for this ManagedWin
> !     variable _top
>
>       # this is the counter of TopLevelWins open
>       # when it hits 0, exit.
>       common numTopWins 0
>
> !     common _screenwidth
> !     common _screenheight
>
> !     method _freeze_me {}
> !     method _thaw_me {}
>
> !     proc dont_remember_size {} { return 0 }
> !   }
>
> +   private {
> +     proc _create {class args}
> +     proc _open {class args}
> +     proc _make_icon_window {name {file "gdbtk_icon"}}
> +   }
>   }
> Index: managedwin.itb
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtk/library/managedwin.itb,v
> retrieving revision 1.9
> diff -p -p -r1.9 managedwin.itb
> *** managedwin.itb	2001/01/04 17:55:48	1.9
> --- managedwin.itb	2001/03/01 03:11:27
> ***************
> *** 1,5 ****
>   # Managed window for GDBtk.
> ! # Copyright 1998, 1999 Cygnus Solutions
>   #
>   # This program is free software; you can redistribute it and/or modify it
>   # under the terms of the GNU General Public License (GPL) as published by
> --- 1,5 ----
>   # Managed window for GDBtk.
> ! # Copyright 1998, 1999, 2000, 2001 Red Hat, Inc.
>   #
>   # This program is free software; you can redistribute it and/or modify it
>   # under the terms of the GNU General Public License (GPL) as published by
> ***************
> *** 12,20 ****
>   # GNU General Public License for more details.
>
>
> ! body ManagedWin::reconfig {} {}
>
>
>   body ManagedWin::window_name {wname {iname ""}} {
>     set top [winfo toplevel [namespace tail $this]]
>     wm title $top $wname
> --- 12,55 ----
>   # GNU General Public License for more details.
>
>
> ! # ------------------------------------------------------------
> ! #  PUBLIC METHOD:  constructor
> ! # ------------------------------------------------------------
> ! body ManagedWin::constructor {args} {
> !   #debug "$this args=$args"
> !   set _top [winfo toplevel $itk_interior]
> ! }
>
> + # ------------------------------------------------------------
> + #  PUBLIC METHOD: destructor
> + # ------------------------------------------------------------
> + body ManagedWin::destructor {} {
>
> +   # save geometry
> +   set g [wm geometry [winfo toplevel [namespace tail $this]]]
> +   pref setd gdb/geometry/[namespace tail $this] $g
> +
> +   # If no toplevels remain, quit.  However, check the quit_if_last
> +   # flag since we might be doing something like displaying a
> +   # splash screen at startup...
> +
> +   if {!$numTopWins && [quit_if_last]} {
> +     # save window positions of remaining windows
> +     foreach obj [itcl_info objects -isa ManagedWin] {
> +       set g [wm geometry [winfo toplevel [namespace tail $obj]]]
> +       pref setd gdb/geometry/[namespace tail $obj] $g
> +     }
> +     pref_save
> +     gdb_force_quit
> +   } else {
> +     destroy_toplevel
> +   }
> + }
> +
> + # ------------------------------------------------------------
> + #  PUBLIC METHOD:  window_name - Set the name of the window
> + #   (and optionally it's icon's name)
> + # ------------------------------------------------------------
>   body ManagedWin::window_name {wname {iname ""}} {
>     set top [winfo toplevel [namespace tail $this]]
>     wm title $top $wname
> *************** body ManagedWin::window_name {wname {ina
> *** 26,38 ****
>   }
>
>   # ------------------------------------------------------------
> ! # pickle - This is the base class pickle method.  It returns a
> ! #  a command that can be used to recreate this particular window.
>   # ------------------------------------------------------------
>   body ManagedWin::pickle {} {
>     return [list ManagedWin::open [namespace tail [info class]]]
>   }
>
>   body ManagedWin::reveal {} {
>     # Do this update to flush all changes before deiconifying the window.
>     update idletasks
> --- 61,77 ----
>   }
>
>   # ------------------------------------------------------------
> ! #  PUBLIC METHOD: pickle - This is the base class pickle
> ! #   method.  It returns a command that can be used to recreate
> ! #   this particular window.
>   # ------------------------------------------------------------
>   body ManagedWin::pickle {} {
>     return [list ManagedWin::open [namespace tail [info class]]]
>   }
>
> + # ------------------------------------------------------------
> + #  PUBLIC METHOD:  reveal
> + # ------------------------------------------------------------
>   body ManagedWin::reveal {} {
>     # Do this update to flush all changes before deiconifying the window.
>     update idletasks
> *************** body ManagedWin::reveal {} {
> *** 48,60 ****
>     # This can actually be confusing to the user.
>   }
>
>   body ManagedWin::restart {} {
>     # This is needed in case we've called "gdbtk_busy" before the restart.
>     # This will configure the stop/run button as necessary
>     after idle gdbtk_idle
>
>     # call the reconfig method for each object
> !   foreach obj $manage_active {
>       if {[catch {$obj reconfig} msg]} {
>         dbug W "reconfig failed for $obj - $msg"
>       }
> --- 87,102 ----
>     # This can actually be confusing to the user.
>   }
>
> + # ------------------------------------------------------------
> + #  PUBLIC PROC:  restart
> + # ------------------------------------------------------------
>   body ManagedWin::restart {} {
>     # This is needed in case we've called "gdbtk_busy" before the restart.
>     # This will configure the stop/run button as necessary
>     after idle gdbtk_idle
>
>     # call the reconfig method for each object
> !   foreach obj [itcl_info objects -isa ManagedWin] {
>       if {[catch {$obj reconfig} msg]} {
>         dbug W "reconfig failed for $obj - $msg"
>       }
> *************** body ManagedWin::restart {} {
> *** 62,75 ****
>   }
>
>   # ------------------------------------------------------------------
> ! #  shutdown - This writes all the active windows to the preferences file,
> ! #  so they can be restored at startup.
> ! #  FIXME: Currently assumes only ONE window per type...
>   # ------------------------------------------------------------------
> -
>   body ManagedWin::shutdown {} {
>     set activeWins {}
> !   foreach win $manage_active {
>       if {[$win isa ManagedWin]} {
>         lappend activeWins [$win pickle]
>       }
> --- 104,116 ----
>   }
>
>   # ------------------------------------------------------------------
> ! #  PUBLIC PROC:  shutdown - This writes all the active windows to
> ! #   the preferences file, so they can be restored at startup.
> ! #   FIXME: Currently assumes only ONE window per type...
>   # ------------------------------------------------------------------
>   body ManagedWin::shutdown {} {
>     set activeWins {}
> !   foreach win [itcl_info objects -isa ManagedWin] {
>       if {[$win isa ManagedWin]} {
>         lappend activeWins [$win pickle]
>       }
> *************** body ManagedWin::shutdown {} {
> *** 78,87 ****
>   }
>
>   # ------------------------------------------------------------------
> ! #  startup - This restores all the windows that were opened at shutdown.
> ! #  FIXME: Currently assumes only ONE window per type...
>   # ------------------------------------------------------------------
> -
>   body ManagedWin::startup {} {
>     debug "Got active list [pref get gdb/window/active]"
>
> --- 119,128 ----
>   }
>
>   # ------------------------------------------------------------------
> ! #  PUBLIC PROC:  startup - This restores all the windows that were
> ! #   opened at shutdown.
> ! #   FIXME: Currently assumes only ONE window per type...
>   # ------------------------------------------------------------------
>   body ManagedWin::startup {} {
>     debug "Got active list [pref get gdb/window/active]"
>
> *************** body ManagedWin::startup {} {
> *** 100,105 ****
> --- 141,149 ----
>     }
>   }
>
> + # ------------------------------------------------------------
> + #  PUBLIC PROC:  open_dlg
> + # ------------------------------------------------------------
>   body ManagedWin::open_dlg {class args} {
>
>     set newwin [eval _open $class $args]
> *************** body ManagedWin::open_dlg {class args} {
> *** 108,115 ****
>       $newwin post
>     }
>   }
> -
>
>   body ManagedWin::open {class args} {
>
>     set newwin [eval _open $class $args]
> --- 152,161 ----
>       $newwin post
>     }
>   }
>
> + # ------------------------------------------------------------
> + #  PUBLIC PROC:  open
> + # ------------------------------------------------------------
>   body ManagedWin::open {class args} {
>
>     set newwin [eval _open $class $args]
> *************** body ManagedWin::open {class args} {
> *** 125,130 ****
> --- 171,179 ----
>     return $newwin
>   }
>
> + # ------------------------------------------------------------
> + #  PRIVATE PROC:  _open
> + # ------------------------------------------------------------
>   body ManagedWin::_open { class args } {
>     debug "$class $args"
>
> *************** body ManagedWin::_open { class args } {
> *** 132,138 ****
>
>     if {!$force} {
>       # check all windows for one of this type
> !     foreach obj $manage_active {
>         if {[$obj isa $class]} {
>   	$obj reveal
>   	return $obj
> --- 181,187 ----
>
>     if {!$force} {
>       # check all windows for one of this type
> !     foreach obj [itcl_info objects -isa ManagedWin] {
>         if {[$obj isa $class]} {
>   	$obj reveal
>   	return $obj
> *************** body ManagedWin::_open { class args } {
> *** 144,149 ****
> --- 193,201 ----
>     return [eval _create $class $args]
>   }
>
> + # ------------------------------------------------------------
> + #  PRIVATE PROC:  _create
> + # ------------------------------------------------------------
>   body ManagedWin::_create { class args } {
>
>     set win [string tolower $class]
> *************** body ManagedWin::_create { class args }
> *** 183,189 ****
>       return ""
>     }
>
> !   wm maxsize $top $screenwidth $screenheight
>     wm minsize $top 20 20
>
>     if {$over != ""} {
> --- 235,241 ----
>       return ""
>     }
>
> !   wm maxsize $top $_screenwidth $_screenheight
>     wm minsize $top 20 20
>
>     if {$over != ""} {
> *************** body ManagedWin::_create { class args }
> *** 207,213 ****
>     } elseif {$::tcl_platform(platform) == "unix"} {
>       # Modal dialogs DONT get Icons...
>       if {[pref get gdb/use_icons] && ![$newwin isa ModalDialog]} {
> !       set icon [make_icon_window ${top}_icon]
>         wm iconwindow $top $icon
>         bind $icon <Double-1> "$newwin reveal"
>       }
> --- 259,265 ----
>     } elseif {$::tcl_platform(platform) == "unix"} {
>       # Modal dialogs DONT get Icons...
>       if {[pref get gdb/use_icons] && ![$newwin isa ModalDialog]} {
> !       set icon [_make_icon_window ${top}_icon]
>         wm iconwindow $top $icon
>         bind $icon <Double-1> "$newwin reveal"
>       }
> *************** body ManagedWin::_create { class args }
> *** 230,239 ****
>         set w 0; set h 0; set x 0; set y 0
>         if {![catch {scan $g  "%dx%d%d%d" w h x y} res]} {
>   	if {$x < 0} {
> ! 	  set x [expr $screenwidth + $x]
>   	}
>   	if {$y < 0} {
> ! 	  set y [expr $screenheight + $y]
>   	}
>
>   	# If the window is transient, then don't reset its size, since
> --- 282,291 ----
>         set w 0; set h 0; set x 0; set y 0
>         if {![catch {scan $g  "%dx%d%d%d" w h x y} res]} {
>   	if {$x < 0} {
> ! 	  set x [expr $_screenwidth + $x]
>   	}
>   	if {$y < 0} {
> ! 	  set y [expr $_screenheight + $y]
>   	}
>
>   	# If the window is transient, then don't reset its size, since
> *************** body ManagedWin::_create { class args }
> *** 249,255 ****
>   	} else {
>   	  set g "${w}x${h}+${x}+${y}"
>   	}
> ! 	if {[expr $x+50] < $screenwidth && [expr $y+20] < $screenheight} {
>   	  wm geometry $top $g
>   	  wm positionfrom $top user
>   	}
> --- 301,307 ----
>   	} else {
>   	  set g "${w}x${h}+${x}+${y}"
>   	}
> ! 	if {[expr $x+50] < $_screenwidth && [expr $y+20] < $_screenheight} {
>   	  wm geometry $top $g
>   	  wm positionfrom $top user
>   	}
> *************** body ManagedWin::_create { class args }
> *** 262,310 ****
>     return $newwin
>   }
>
>   body ManagedWin::find { win } {
>     debug "$win"
>     set res ""
> !   foreach obj $manage_active {
>       if {[$obj isa $win]} {
>         lappend res $obj
>       }
>     }
>     return $res
>   }
> -
> - body ManagedWin::enable { on } {
> - }
>
> !
>   body ManagedWin::init {} {
>     debug
>     wm withdraw .
> !   set screenheight [winfo screenheight .]
> !   set screenwidth [winfo screenwidth .]
>   }
>
>   body ManagedWin::destroy_toplevel {} {
> !   after idle "update idletasks;destroy $Top"
>   }
>
> ! body ManagedWin::freeze_me {} {
> !   $Top configure -cursor watch
>     ::update idletasks
>   }
>
> ! body ManagedWin::thaw_me {} {
>
> !   $Top configure -cursor {}
>     ::update idletasks
>   }
>
>   # ------------------------------------------------------------------
> ! #  make_icon_window - create a small window with an icon in
> ! #  it for use by certain Unix window managers.
>   # ------------------------------------------------------------------
> !
> ! body ManagedWin::make_icon_window {name {file "gdbtk_icon"}} {
>     if {![winfo exists $name]} {
>       toplevel $name
>       label $name.im -image \
> --- 314,372 ----
>     return $newwin
>   }
>
> + # ------------------------------------------------------------
> + #  PUBLIC PROC:  find
> + # ------------------------------------------------------------
>   body ManagedWin::find { win } {
>     debug "$win"
>     set res ""
> !   foreach obj [itcl_info objects -isa ManagedWin] {
>       if {[$obj isa $win]} {
>         lappend res $obj
>       }
>     }
>     return $res
>   }
>
> ! # ------------------------------------------------------------
> ! #  PUBLIC PROC:  init
> ! # ------------------------------------------------------------
>   body ManagedWin::init {} {
>     debug
>     wm withdraw .
> !   set _screenheight [winfo screenheight .]
> !   set _screenwidth [winfo screenwidth .]
>   }
>
> + # ------------------------------------------------------------
> + #  PUBLIC METHOD:  destroy_toplevel
> + # ------------------------------------------------------------
>   body ManagedWin::destroy_toplevel {} {
> !   after idle "update idletasks;destroy $_top"
>   }
>
> ! # ------------------------------------------------------------
> ! #  PRIVATE METHOD:  _freeze_me
> ! # ------------------------------------------------------------
> ! body ManagedWin::_freeze_me {} {
> !   $_top configure -cursor watch
>     ::update idletasks
>   }
>
> ! # ------------------------------------------------------------
> ! #  PRIVATE METHOD: _thaw_me
> ! # ------------------------------------------------------------
> ! body ManagedWin::_thaw_me {} {
>
> !   $_top configure -cursor {}
>     ::update idletasks
>   }
>
>   # ------------------------------------------------------------------
> ! #  PRIVATE PROC: _make_icon_window - create a small window with an
> ! #   icon in it for use by certain Unix window managers.
>   # ------------------------------------------------------------------
> ! body ManagedWin::_make_icon_window {name {file "gdbtk_icon"}} {
>     if {![winfo exists $name]} {
>       toplevel $name
>       label $name.im -image \
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]