Commit e48617d5fac3a12348f62e6b375ed450ce8e81d8
1 parent
f9fc1c8d
Exists in
master
and in
1 other branch
Working on debug window.
Showing
2 changed files
with
48 additions
and
0 deletions
Show diff stats
src/testprogram/testprogram.c
@@ -258,6 +258,10 @@ static GtkToolItem * create_tool_item(GtkWidget *terminal, const gchar *label, c | @@ -258,6 +258,10 @@ static GtkToolItem * create_tool_item(GtkWidget *terminal, const gchar *label, c | ||
258 | GtkToolItem * item = gtk_toggle_tool_button_new(); | 258 | GtkToolItem * item = gtk_toggle_tool_button_new(); |
259 | gtk_tool_button_set_label(GTK_TOOL_BUTTON(item),label); | 259 | gtk_tool_button_set_label(GTK_TOOL_BUTTON(item),label); |
260 | 260 | ||
261 | + gtk_widget_set_can_focus(item,FALSE); | ||
262 | + gtk_widget_set_can_default(item,FALSE); | ||
263 | + gtk_widget_set_focus_on_click(item,FALSE); | ||
264 | + | ||
261 | g_signal_connect(GTK_WIDGET(item), "toggled", G_CALLBACK(callback), terminal); | 265 | g_signal_connect(GTK_WIDGET(item), "toggled", G_CALLBACK(callback), terminal); |
262 | 266 | ||
263 | if(tooltip) | 267 | if(tooltip) |
src/trace/exec.c
@@ -107,6 +107,42 @@ | @@ -107,6 +107,42 @@ | ||
107 | 107 | ||
108 | } | 108 | } |
109 | 109 | ||
110 | + static int get_property(GtkWidget *widget, const gchar *name) | ||
111 | + { | ||
112 | + GParamSpec * spec = g_object_class_find_property(G_OBJECT_GET_CLASS(widget),name); | ||
113 | + | ||
114 | + if(!spec) { | ||
115 | + return errno = ENOENT; | ||
116 | + } | ||
117 | + | ||
118 | + GValue val = G_VALUE_INIT; | ||
119 | + | ||
120 | + g_value_init(&val, spec->value_type); | ||
121 | + g_object_get_property(G_OBJECT(widget),name,&val); | ||
122 | + | ||
123 | + switch(spec->value_type) | ||
124 | + { | ||
125 | + case G_TYPE_STRING: | ||
126 | + lib3270_write_trace(v3270_get_session(widget),"%s=%s",spec->name,g_value_get_string(&val)); | ||
127 | + break; | ||
128 | + | ||
129 | + case G_TYPE_BOOLEAN: | ||
130 | + lib3270_write_trace(v3270_get_session(widget),"%s=%s",spec->name,(g_value_get_boolean(&val) ? "true" : "false")); | ||
131 | + break; | ||
132 | + | ||
133 | + case G_TYPE_INT: | ||
134 | + lib3270_write_trace(v3270_get_session(widget),"%s=%d",spec->name,g_value_get_int(&val)); | ||
135 | + break; | ||
136 | + | ||
137 | + default: | ||
138 | + lib3270_write_trace(v3270_get_session(widget),"%s has an unexpected value type",spec->name); | ||
139 | + | ||
140 | + } | ||
141 | + | ||
142 | + g_value_unset(&val); | ||
143 | + return 0; | ||
144 | + } | ||
145 | + | ||
110 | int v3270_exec_command(GtkWidget *widget, const gchar *text) | 146 | int v3270_exec_command(GtkWidget *widget, const gchar *text) |
111 | { | 147 | { |
112 | size_t ix; | 148 | size_t ix; |
@@ -138,6 +174,14 @@ | @@ -138,6 +174,14 @@ | ||
138 | return set_property(hSession,name,(*txtptr ? txtptr : "1")); | 174 | return set_property(hSession,name,(*txtptr ? txtptr : "1")); |
139 | } | 175 | } |
140 | 176 | ||
177 | + if(g_str_has_prefix(cmdline,"get")) | ||
178 | + { | ||
179 | + gchar *txtptr = cmdline+3; | ||
180 | + const gchar * name = get_word(&txtptr); | ||
181 | + g_strstrip(txtptr); | ||
182 | + return get_property(widget,name); | ||
183 | + } | ||
184 | + | ||
141 | if(g_str_has_prefix(cmdline,"reset")) | 185 | if(g_str_has_prefix(cmdline,"reset")) |
142 | { | 186 | { |
143 | gchar *txtptr = cmdline+3; | 187 | gchar *txtptr = cmdline+3; |