public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* Adding a menu button (the 2nd :-)
@ 2001-02-19 23:21 Armin Herzer
  2001-02-20  0:41 ` Khamis Abuelkomboz (UUNET)
  0 siblings, 1 reply; 2+ messages in thread
From: Armin Herzer @ 2001-02-19 23:21 UTC (permalink / raw)
  To: sourcenav

Hello all,

in addition to my mail from yesterday, here is a detailed description of
what I done:

1. Opened this link:
http://sources.redhat.com/sourcenav/online-docs/progref/custom.html#pgfId-1285642

2. Copied from this link the following code:

proc sn_rc_symbolbrowser {top menu} {
  global tcl_platform

  set tool_frame $top.exp

  # Set a variable that identifies the text widget on
  # the status bar.
  set info $top.msg.msg

  # Create a new button on the toolbar. Note that the
  # button's command invokes the command line tool
  # in the background so that Source-Navigator is not
  # blocked while the tool is running. On Win32, we emulate
  # `xterm' with `cmd'.

  if {!$tcl_platform(platform) != "windows"} {
    set cmdline "exec xterm -T {Source-Navigator} &"
    set description xterm
  } else {
    set cmdline "exec cmd /c start cmd"
    set description shell
  }
  button $tool_frame.xterm -text $description \
      -command $cmdline

  # Set the main window's status bar to read "xterm"
  # or "shell" when the mouse pointer is over the region
  # of the button.
  balloon_bind_info $tool_frame.xterm \
      "Starts a new $description"
  bind $tool_frame.xterm <Leave> "set $top.msg {}"

  # Pack this button onto the toolbar.
  pack $tool_frame.xterm -side left
}

3. Saved the code as rc.tcl in path C:\soft\cygnus\sn452\share\etc

4. Started Source Navigator and expected the new button, but it wasn't
there :-(

Maybe I missed something? What I didn't understand is the following
sequence from
the link mentioned above:

When a Source-Navigator project opens, a Tcl procedure called sn_rc (if
it exists)
is called with no input parameters. This enables you to: ...

Where should the file sn_rc be located? I do not find this file? Or is
this the
wrong way?

Thank you for helping,

Armin Herzer

---------------------------------------------------------------------------------

Fachhochschule Ravensburg-Weingarten
University of Applied Sciences

Postfach 1261

88241 Weingarten

Germany

http://www.fh-weingarten.de



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Adding a menu button (the 2nd :-)
  2001-02-19 23:21 Adding a menu button (the 2nd :-) Armin Herzer
@ 2001-02-20  0:41 ` Khamis Abuelkomboz (UUNET)
  0 siblings, 0 replies; 2+ messages in thread
From: Khamis Abuelkomboz (UUNET) @ 2001-02-20  0:41 UTC (permalink / raw)
  To: sourcenav

I tested it my self and worked without any problems, the
menu "Extras" appear in the menu of the symbol browser!

Attatched is the rc.tcl file with the copied example from
the link

http://sources.redhat.com/sourcenav/online-docs/progref/custom.html#pgfId-1285642

Did you install SN twice?

khamis


Armin Herzer wrote:

> Hello all,
> 
> in addition to my mail from yesterday, here is a detailed description of
> what I done:
> 
> 1. Opened this link:
> http://sources.redhat.com/sourcenav/online-docs/progref/custom.html#pgfId-1285642
> 
> 2. Copied from this link the following code:
> 
> proc sn_rc_symbolbrowser {top menu} {
>   global tcl_platform
> 
>   set tool_frame $top.exp
> 
>   # Set a variable that identifies the text widget on
>   # the status bar.
>   set info $top.msg.msg
> 
>   # Create a new button on the toolbar. Note that the
>   # button's command invokes the command line tool
>   # in the background so that Source-Navigator is not
>   # blocked while the tool is running. On Win32, we emulate
>   # `xterm' with `cmd'.
> 
>   if {!$tcl_platform(platform) != "windows"} {
>     set cmdline "exec xterm -T {Source-Navigator} &"
>     set description xterm
>   } else {
>     set cmdline "exec cmd /c start cmd"
>     set description shell
>   }
>   button $tool_frame.xterm -text $description \
>       -command $cmdline
> 
>   # Set the main window's status bar to read "xterm"
>   # or "shell" when the mouse pointer is over the region
>   # of the button.
>   balloon_bind_info $tool_frame.xterm \
>       "Starts a new $description"
>   bind $tool_frame.xterm <Leave> "set $top.msg {}"
> 
>   # Pack this button onto the toolbar.
>   pack $tool_frame.xterm -side left
> }
> 
> 3. Saved the code as rc.tcl in path C:\soft\cygnus\sn452\share\etc
> 
> 4. Started Source Navigator and expected the new button, but it wasn't
> there :-(
> 
> Maybe I missed something? What I didn't understand is the following
> sequence from
> the link mentioned above:
> 
> When a Source-Navigator project opens, a Tcl procedure called sn_rc (if
> it exists)
> is called with no input parameters. This enables you to: ...
> 
> Where should the file sn_rc be located? I do not find this file? Or is
> this the
> wrong way?
> 
> Thank you for helping,
> 
> Armin Herzer
> 
> ---------------------------------------------------------------------------------
> 
> Fachhochschule Ravensburg-Weingarten
> University of Applied Sciences
> 
> Postfach 1261
> 
> 88241 Weingarten
> 
> Germany
> 
> http://www.fh-weingarten.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-02-20  0:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-19 23:21 Adding a menu button (the 2nd :-) Armin Herzer
2001-02-20  0:41 ` Khamis Abuelkomboz (UUNET)

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).