summaryrefslogtreecommitdiff
path: root/gdb/gdbtk/plugins/rhabout/rhabout.itcl
blob: 02a83517dfd8576f3026ea131c0605986a9d7161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
class RHAbout {
  inherit PluginWindow
  constructor {args} {
    global gdb_ImageDir

    # What about a menu?
    $menubar add menubutton file "File" 0
    $menubar add command None "Close" \
      [code $this destroy_toplevel] \
      -underline 1
    $menubar add menubutton help "Help" 0
    $menubar add command Other "Help Topics" \
      {open_help index.html} \
      -underline 0
    $menubar add separator
    $menubar add command Other "About GDB..." \
      {ManagedWin::open About -transient} \
      -underline 0

    # The menu only shows up if you do this:
    $menubar show

    # Do you want a toolbar?
    $toolbar add button con Other {ManagedWin::open Console} \
                           "Console (Ctrl+N)" -image console_img

    # The toolbar will only show up if you do this:
    $toolbar show

    # Now, fill the childsite with some graphics and text

    # Remember to use the childsite, do not pack in the widget hull
    set f [childsite]

    # Put in some graphics
    label $f.image1 -bg white -image \
      [image create photo -file [file join $gdb_ImageDir insight.gif]]

    # Here we call an interface function provided by GDBTCL
    set text [gdb_cmd {show version}]

    # Here we call a command procedure that we created, if it exists
    catch {append text [rhabout_extra_text]}

    # Now add the text
    message $f.m -bg white -fg black -text $text -aspect 500 -relief flat

    # Add a status bar so we can show some dynamic information
    set _status [label $f.stat -relief sunken -bd 3 \
                   -font global/status -height 1]

    # pack everything
    pack $f.image1 $f.m -fill both -expand yes
    pack $f.stat -expand 1 -fill both
    pack $itk_interior

    # Give our sample window a name
    window_name "About Red Hat Insight Plug-In"
  }

  # You can overload the base class busy method, but make sure
  # to call it as well or the menu and button status will not be updated
  # (unless this is what you want)
  public method busy {event} {
    debug
    # Call the baseclass version
    PluginWindow::busy $event

    # Display something in the status area
    $_status configure -text "Running..."
  }

  # You can overload the base class idle method, but make sure
  # to call it as well or the menu and button status will not be updated
  # (unless this is what you want)
  private method idle {} {
    debug
    # First call the baseclass version
    PluginWindow::idle

    # Display something in the status area
    $_status configure -text "Stopped."
  }

  # Path to the status area
  private variable _status
}