diff --git a/src/actions/lib3270.c b/src/actions/lib3270.c index c4f7289..416549f 100644 --- a/src/actions/lib3270.c +++ b/src/actions/lib3270.c @@ -70,8 +70,12 @@ H3270 * hSession = pw3270_window_get_session_handle(window); + debug("Activating action %s on hSession %p", pw3270_action_get_name(action), hSession); + if(hSession) PW3270_LIB3270_ACTION(action)->definition->activate(hSession); + else + g_message("Action \"%s\" requires a lib3270 session", pw3270_action_get_name(action)); } diff --git a/src/actions/testprogram/testprogram.c b/src/actions/testprogram/testprogram.c index 31915ae..506df65 100644 --- a/src/actions/testprogram/testprogram.c +++ b/src/actions/testprogram/testprogram.c @@ -36,12 +36,12 @@ /*---[ Implement ]----------------------------------------------------------------------------------*/ - GtkWidget * pw3270_window_get_terminal_widget(GtkWidget G_GNUC_UNUSED(*window)) { - return NULL; + GtkWidget * pw3270_window_get_terminal_widget(GtkWidget *window) { + return g_object_get_data(G_OBJECT(window), "v3270_terminal"); } - H3270 * pw3270_window_get_session_handle(GtkWidget G_GNUC_UNUSED(*window)) { - return NULL; + H3270 * pw3270_window_get_session_handle(GtkWidget *window) { + return v3270_get_session(pw3270_window_get_terminal_widget(window)); } static gboolean handle_command(GtkWidget *trace, const gchar *cmd, const gchar *args, GtkWidget *window) { @@ -71,6 +71,8 @@ GtkWidget * notebook = gtk_notebook_new(); GtkWidget * toolbar = gtk_toolbar_new(); + g_object_set_data(G_OBJECT(window),"v3270_terminal",terminal); + pw3270_window_add_actions(window); gtk_box_pack_start(GTK_BOX(vBox),toolbar,FALSE,TRUE,0); -- libgit2 0.21.2