Commit eefff92b authored by Claes Sjofors's avatar Claes Sjofors

Ge set subwindow fix

parent 5e97edf7
......@@ -4214,6 +4214,7 @@ int Graph::set_subwindow_source(const char* name, char* source, char* owner)
int sts;
grow_tObject object;
GrowCtx* ctx;
bool remove_self = false;
ctx = grow->ctx;
grow->push(); // If command executed from a subwindow
......@@ -4225,6 +4226,9 @@ int Graph::set_subwindow_source(const char* name, char* source, char* owner)
if (grow_GetObjectType(object) != glow_eObjectType_GrowWindow)
return 0;
if ( grow_GetWindowCtx(object) == ctx)
remove_self = true;
grow_EnableEvent(grow->ctx, glow_eEvent_Translate, glow_eEventType_CallBack,
graph_grow_cb);
......@@ -4232,10 +4236,13 @@ int Graph::set_subwindow_source(const char* name, char* source, char* owner)
grow_DisableEvent(grow->ctx, glow_eEvent_Translate);
if (ctx != grow->ctx)
if (ctx != grow->ctx) {
if ( remove_self)
ctx = 0; // Should not be used!!
grow->pop(ctx);
}
if (sts)
if (remove_self)
return GLOW__SUBTERMINATED;
return 1;
}
......
......@@ -66,7 +66,7 @@ public:
GlowArray(int allocate, int incr);
//! Noargs constructor.
GlowArray(){}
GlowArray(): allocated(0),alloc_incr(0),a_size(0),a(NULL) {}
//! Initiates an array to be a copy of another array.
/*!
......
......@@ -116,7 +116,7 @@ GlowCtx::~GlowCtx()
i--;
}
if (comment)
free(comment);
delete comment;
}
void GlowCtx::delete_all()
......
......@@ -5407,6 +5407,11 @@ int grow_SetWindowSource(grow_tObject window, char* source, char* owner)
return ((GrowWindow*)window)->set_source(source, owner);
}
grow_tCtx grow_GetWindowCtx( grow_tObject window)
{
return ((GrowWindow *)window)->window_ctx;
}
void grow_GetWindowSize(grow_tCtx ctx, int* width, int* height)
{
*width = ctx->mw.window_width;
......@@ -5752,4 +5757,6 @@ void grow_NavRedraw(grow_tCtx ctx)
((GrowCtx*)ctx)->nav_zoom();
}
/*@}*/
......@@ -3211,6 +3211,7 @@ void grow_GetSubmenuPosition(grow_tObject menu, int item, double* x, double* y);
int grow_GetMenuParent(grow_tObject menu, grow_tObject* parent);
int grow_SetFolderIndex(grow_tObject folder, int idx);
int grow_SetWindowSource(grow_tObject window, char* source, char* owner);
grow_tCtx grow_GetWindowCtx( grow_tObject window);
void grow_GetWindowSize(grow_tCtx ctx, int* width, int* height);
int grow_IsJava(char* name, int* is_frame, int* is_applet, char* java_name);
void grow_GetOwner(grow_tCtx ctx, char* owner);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment