summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2006-06-04 19:23:49 +0000
committerAkira TAGOH <akira@tagoh.org>2006-06-04 19:23:49 +0000
commite6c1cf4fdca4cb36300a1576709966be67f4b921 (patch)
tree6378c23845ecd49a642fa91b4786409464df6ede /src
parent946191d7adfa2d744979207bca1e7ad01d89b1f5 (diff)
* src/visualizer.c (hg_memory_visualizer_real_destroy): set a null to
avoid a double-free. * src/hgspy.c (_hgspy_action_menubar_open_cb): set a filter name. (main): set a window title and added a view menu.
Diffstat (limited to 'src')
-rw-r--r--src/hgspy.c39
-rw-r--r--src/visualizer.c8
2 files changed, 43 insertions, 4 deletions
diff --git a/src/hgspy.c b/src/hgspy.c
index cab4ce4..0f2887e 100644
--- a/src/hgspy.c
+++ b/src/hgspy.c
@@ -100,6 +100,7 @@ _hgspy_action_menubar_open_cb(GtkAction *action,
GtkFileFilter *filter;
filter = gtk_file_filter_new();
+ gtk_file_filter_set_name(filter, _("PostScript file"));
gtk_file_filter_add_mime_type(filter, "application/postscript");
dialog = gtk_file_chooser_dialog_new(_("Open a PostScript file"),
@@ -178,7 +179,7 @@ main(int argc,
{
GModule *module;
HgSpy *spy;
- GtkWidget *menubar, *vbox;
+ GtkWidget *menubar, *vbox, *none;
GtkUIManager *uiman;
GtkActionGroup *actions;
GtkActionEntry action_entries[] = {
@@ -186,7 +187,15 @@ main(int argc,
{
.name = "VMMenu",
.stock_id = NULL,
- .label = _("_VM"),
+ .label = _("V_M"),
+ .accelerator = NULL,
+ .tooltip = NULL,
+ .callback = NULL
+ },
+ {
+ .name = "ViewMenu",
+ .stock_id = NULL,
+ .label = _("_View"),
.accelerator = NULL,
.tooltip = NULL,
.callback = NULL
@@ -224,6 +233,24 @@ main(int argc,
.tooltip = _("Quit"),
.callback = G_CALLBACK (_hgspy_action_menubar_quit_cb)
},
+ /* submenu - View */
+ {
+ .name = "PoolMenu",
+ .stock_id = NULL,
+ .label = _("Pool"),
+ .accelerator = NULL,
+ .tooltip = _("Pool to be visualized."),
+ .callback = NULL
+ },
+ /* submenu - Pool */
+ {
+ .name = "PoolNone",
+ .stock_id = NULL,
+ .label = _("None"),
+ .accelerator = NULL,
+ .tooltip = NULL,
+ .callback = NULL
+ },
/* submenu - Help */
{
.name = "About",
@@ -243,6 +270,11 @@ main(int argc,
" <separator/>"
" <menuitem action='Quit'/>"
" </menu>"
+ " <menu action='ViewMenu'>"
+ " <menu action='PoolMenu'>"
+ " <menuitem action='PoolNone'/>"
+ " </menu>"
+ " </menu>"
" <menu action='HelpMenu'>"
" <menuitem action='About'/>"
" </menu>"
@@ -290,8 +322,11 @@ main(int argc,
spy);
/* setup UI */
+ gtk_window_set_title(GTK_WINDOW (spy->window), "Memory Visualizer for Hieroglyph");
gtk_ui_manager_add_ui_from_string(uiman, uixml, strlen(uixml), NULL);
gtk_ui_manager_insert_action_group(uiman, actions, 0);
+ none = gtk_ui_manager_get_widget(uiman, "/MenuBar/ViewMenu/PoolMenu/PoolNone");
+ gtk_widget_set_sensitive(none, FALSE);
/* setup accelerators */
gtk_window_add_accel_group(GTK_WINDOW (spy->window), gtk_ui_manager_get_accel_group(uiman));
diff --git a/src/visualizer.c b/src/visualizer.c
index 61d1185..4386242 100644
--- a/src/visualizer.c
+++ b/src/visualizer.c
@@ -117,10 +117,14 @@ hg_memory_visualizer_real_destroy(GtkObject *object)
g_return_if_fail (HG_IS_MEMORY_VISUALIZER (object));
visual = HG_MEMORY_VISUALIZER (object);
- if (visual->pool2size)
+ if (visual->pool2size) {
g_hash_table_destroy(visual->pool2size);
- if (visual->pool2array)
+ visual->pool2size = NULL;
+ }
+ if (visual->pool2array) {
g_hash_table_destroy(visual->pool2array);
+ visual->pool2array = NULL;
+ }
/* FIXME: not yet implemented */