public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: James Ingham <jingham@cygnus.com>
To: Steven Johnson <sbjohnson@ozemail.com.au>
Cc: insight@sourceware.cygnus.com
Subject: Re: Register Window Height Patch
Date: Mon, 03 Apr 2000 15:32:00 -0000	[thread overview]
Message-ID: <14569.7315.271935.303866@leda.cygnus.com> (raw)
In-Reply-To: <38E8879D.8A14110F@ozemail.com.au>

Steven,

Allowing the user to set the default # of rows is a good idea.  

Actually, better would be to have the register window able to resize
in some reasonable way.  I haven't done this yet, because I also want
to convert the window to use the TkTable widget (the one that the
Memory window uses.)  Tables made out of lots of entries draw very
slowly on Windows, whereas the TkTable widget doesn't have this
problem.  Just haven't had the time to do this yet...

Anyway, on to your patch.  First of all, you have to either call "pref
define" on your preference before you call "pref get", or call "pref
getd" to get its value.  If you call "pref get" on an undefined
preference, then you will get an error.  You probably didn't see this
because you had already put the preference in your preference file
before you put the "pref get" call in your code, which effectively
causes it to get defined.

The way we set up preferences in Insight is to put the definition of
the preference in the file prefs.tcl, using the "prefs define"
command.  We only use "pref getd" in cases when we are auto-gening
the names of preferences. 

The main reason for this is to provide a central location for all the
preferences in the program.  Otherwise it will just be too hard to
figure out all the settable things in Insight.  

Also, it would be nice at some point to add a type to the "pref
define" command so you could say:

pref define gdb/reg/rows 16 integer

and have the pref system check all pref set's & pref get's against
this type.  Centralizing this information now will allow us to play
this sort of game in the future.

Oh, by the way, there are two prefs.tcl, one in libgui/library, and
one in gdb/gdbtk/library.  The former implements the preference
system, and the latter is Insight's list of preferences, and some UI
stuff.  You want to put your pref define in the latter.

Finally, as to removing registers.  This works for me, at least,
though the set of removed registers is not remembered when you close
the register window & open it again.  This is a known bug.  We really
need to come up with a nicer UI for organizing register sets and so
on.

Jim

 > Attached is a patch to the Register Window Code that allow the number of
 > registers vertically to
 > be specified in the .gdbtkinit file. (Usefull if you have lots of target
 > registers like the PowerPC.)
 > 
 > This is my first patch for Insight. If I have done anything wrong, or it
 > is prefered to be done in a different
 > way, let me know.
 > 
 > Steven Johnson.
 > 
 > diff ./regwin.itb /opt/powerpc-gdb/share/gdbtcl/regwin.itb
 > 350c350,354
 > <   set rows 16
 > ---
 > >   set rows [pref get gdb/reg/rows]
 > >   if {$rows == ""} {
 > >     set rows 16
 > >     pref setd gdb/reg/rows 16
 > >   }
 > 
 > 
 > 
 > Also, with regard to the register window I find that hiding registers
 > does not work. Does anyone else have this problem?
 > 

-- 
++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++
Jim Ingham                                              jingham@cygnus.com
Cygnus Solutions, a Red Hat Company                      

  reply	other threads:[~2000-04-03 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-03 15:03 Steven Johnson
2000-04-03 15:32 ` James Ingham [this message]
2000-04-03 16:10   ` Steven Johnson
2000-04-03 16:44     ` James Ingham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14569.7315.271935.303866@leda.cygnus.com \
    --to=jingham@cygnus.com \
    --cc=insight@sourceware.cygnus.com \
    --cc=sbjohnson@ozemail.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).