summaryrefslogtreecommitdiffhomepage
path: root/mixgtk/mixgtk_mixvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'mixgtk/mixgtk_mixvm.c')
-rw-r--r--mixgtk/mixgtk_mixvm.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/mixgtk/mixgtk_mixvm.c b/mixgtk/mixgtk_mixvm.c
index b3a52c1..bee588a 100644
--- a/mixgtk/mixgtk_mixvm.c
+++ b/mixgtk/mixgtk_mixvm.c
@@ -34,8 +34,8 @@
static GtkEntry *reg_entries_[REGISTER_NO_];
static GtkTooltips *tips_;
static GtkEntry *loc_entry_;
-static GtkWidget *goto_;
-static GtkEntry *goto_entry_;
+static GtkWidget *goto_ = NULL;
+static GtkEntry *goto_entry_ = NULL;
static GtkToggleButton *over_button_;
static GtkToggleButton *cmp_buttons_[3];
static GtkCList *memory_;
@@ -47,6 +47,16 @@ static mix_vm_t *vm_;
#define GOTO_ENTRY_NAME_ "goto_entry"
static void
+init_goto_ (void)
+{
+ goto_ = mixgtk_widget_factory_get_dialog (MIXGTK_GOTO_DIALOG);
+ g_assert (goto_ != NULL);
+ goto_entry_ = GTK_ENTRY (mixgtk_widget_factory_get_child_by_name (
+ MIXGTK_GOTO_DIALOG, GOTO_ENTRY_NAME_));
+ g_assert (goto_entry_ != NULL);
+}
+
+static void
update_register_ (mixgtk_widget_id_t reg)
{
static gchar BUFFER[20];
@@ -161,15 +171,6 @@ mixgtk_mixvm_init (mix_vm_t *vm)
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (on_mem_adj_change_), NULL);
- goto_ = mixgtk_widget_factory_get (MIXGTK_WIDGET_GOTO_DIALOG);
- g_return_val_if_fail (goto_ != NULL, FALSE);
-
- goto_entry_ = GTK_ENTRY (mixgtk_widget_factory_get_by_name
- (GOTO_ENTRY_NAME_));
- g_return_val_if_fail (goto_entry_ != NULL, FALSE);
-
- mixgtk_mixvm_update_vm_widgets ();
-
return TRUE;
}
@@ -400,6 +401,7 @@ on_memory_cells_select_row (GtkCList *w, gint row, gint col,
void
on_memory_cells_click_column (GtkCList *w, gint row, gpointer data)
{
+ if (!goto_) init_goto_ ();
gtk_widget_show (goto_);
}