Deiconify and popup a widget

Hi!

Do you think these two pieces of code below are correct if I want to deiconify and popup a top level shell widget?

void
top_level_shell_deiconify (Widget w)
{
Widget shell;

shell = get_shell(w);

XMapWindow (XtDisplay (shell), XtWindow (shell));
}

void
widget_popup (Widget w,
int grab_kind)
{

Boolean iconic;
Widget shell = get_shell(w) ;

XtVaGetValues (shell,
XtNiconic, &iconic,
NULL);

XtVaSetValues (shell,
XtNiconic, False,
NULL);

XtPopup(shell, get_grab_kind(grab_kind));
XRaiseWindow(UxDisplay, XtWindow(shell));
}

Thanks