I have a dialog on which I have placed an image. Using a timer I display the dialog until the timer limit is reached. Everything works correctly except I would like to (1.) remove the header on the dialog so that only the image is visible and (2.) display the dialog in the center of the screen. NOTE Achieving 1. is more important to me than achieving 2. Any help would be greatly appreciated. Thanks... |
|||

Anonymous
Splash Screen Affect...
I guess your dialog is not overrideshell. If you create your dialog using overidershell widget, the window manager will not create header title bar and border decorates.
ICS_support
Splash Screen Affect...
There is sample code at http//www.motifzone.com/tmd/tmd_letter_archive.html#intro_screen for what you want to do.
See also the information at http//www.motifzone.com/tmd/tmd_letter_archive.html#notitle .
evolver
Re: Splash Screen Affect...
I am really curious to see the examples but the links are broken... Does anybody have a copy of this information or working links?
Thanks!
/Sergey
tolstiy
webarchive?
8<----------------
I have a program and would like to program an introduction screen which is a bitmap of a plum. My question is, how can I program this introduction screen to popup and stay up and then have the program shift in my main program?
I am terribly stuck and will greatly appreciated any response.
Erich J. Ruth, 29-Jun-98
*
RE: creating an introductory screen
Erich,
This technique is a common way to give the user feedback that the application is starting up. Some applications display contact or copyright information in this initial screen, along with a logo of some sort. In the background, the application is creating its main windows.
You face a few issues in making this happen:
1. while the introductory screen is up, it needs to refresh itself if it is ever obscured and re-exposed (and, if you put a button on the introductory screen for cancelling the start-up, or for dismissing the introductory screen, events on that button need to be handled)
2. while the introductory screen is up, the rest of the application needs to be created, piece by piece
3. when the rest of the application is ready, the popup should go away
I've created a quick sample program which shows one way to get around these problems. It creates an introductory screen as a popup shell. The rest of the application is created in a work procedure. When the rest of the application is created, the popup is destroyed. Two event loops monitor the state of the application (for clarity); the first handles events during creation, and the second handles the rest of the program. I hope the sample satisfies your questions.
David Lewis, 29-Jun-98
8<-----------
/* simple test program */
#include
#include
#define intro_width 16
#define intro_height 16
static unsigned char intro_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x80, 0x00, 0x00, 0x01,
0x80, 0x03, 0x40, 0x04, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0x40, 0x04,
0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
typedef enum { InitialState, ShowingIntroScreen, NormalRunning, Quitting }
RunState;
static RunState done = InitialState;
static char *explanation[] = {
"Demo of intro screen.",
};
static void doExplanation(void)
}
{
int i;
for (i = 0; i
static void quitCB(Widget w, XtPointer client, XtPointer call)
{
done = Quitting;
}
static void createQuit(Widget quit_parent)
{
Widget button = XmCreatePushButton(quit_parent, "quit", NULL, 0);
XtManageChild(button);
XtAddCallback(button, XmNactivateCallback, quitCB, (XtPointer)NULL);
}
static Widget createIntroductoryScreen(Widget parent)
{
Arg args[2]; int n;
Widget popup;
Widget rc;
Widget text;
Widget label;
n=0;
XtSetArg(args[n], XmNallowShellResize, True); n++;
popup = XtCreatePopupShell("intro",
transientShellWidgetClass, parent, args, n);
rc = XmCreateRowColumn(popup, "rc", NULL, 0);
text = XmCreateText(rc, "text", NULL, 0);
XtVaSetValues(text,
XmNeditMode, XmMULTI_LINE_EDIT,
XmNrows, 5,
XmNeditable, False,
XmNvalue, "This is the introductory\napplication screen.\n(That's a plum below.)",
NULL);
XtManageChild(text);
n = 0;
XtSetArg(args[n], XmNlabelType, XmPIXMAP); n++;
label = XmCreateLabel(rc, "label", args, n);
XtManageChild(label);
XtManageChild(rc);
done = ShowingIntroScreen;
XtPopup(popup, XtGrabNone); /* creates window */
n = 0;
XtSetArg(args[n], XmNlabelPixmap,
XCreatePixmapFromBitmapData(XtDisplay(popup),
XtWindow(popup),
intro_bits,
intro_width, intro_height,
XBlackPixelOfScreen(XtScreen(popup)),
XWhitePixelOfScreen(XtScreen(popup)),
DefaultDepthOfScreen(XtScreen(popup)))
); n++;
XtSetValues(label, args, n);
return popup;
}
static void createScreen(Widget parent)
{
Widget top = XmCreatePanedWindow(parent, "pane", NULL,0);
XtManageChild(top);
{
Widget text = XmCreateText(top, "text", NULL, 0);
XtVaSetValues(text,
XmNeditMode, XmMULTI_LINE_EDIT,
XmNrows, 5,
XmNeditable, False,
XmNvalue, "This is the real\napplication screen.",
NULL);
XtManageChild(text);
}
createQuit(top);
}
static Boolean backgroundProc(XtPointer closure)
{
static int i = 0;
Widget app_shell = (Widget) closure;
Boolean retval;
/* In this background procedure, do all the other initialization, a
** little bit at a time. But we just waste some time and continue.
*/
fprintf(stderr,"work proc %d\n",i);
if (i < 10)
{
/* fake out a whole bunch of steps */
i++;
sleep (2);
retval = False;
}
else
{
/* the final step */
createScreen(app_shell);
XtRealizeWidget(app_shell);
/* and then we flip the flags */
done = NormalRunning;
retval = True;
}
return retval;
}
#define CLASS "Test"
int main (argc,argv)
int argc;
char *argv[];
{
XtAppContext app_context;
Widget app_shell;
Display *display;
Widget popup;
doExplanation();
XtToolkitInitialize ();
app_context = XtCreateApplicationContext();
display = XtOpenDisplay (app_context, NULL, argv[0], CLASS,
NULL, 0, &argc, argv);
if (!display)
{
XtWarning ("can't open display, exiting...");
exit (0);
}
app_shell = XtAppCreateShell (NULL, CLASS,
applicationShellWidgetClass, display, NULL, 0);
XtVaSetValues(app_shell,XmNallowShellResize, True, NULL);
/* create popup introductory screen */
popup = createIntroductoryScreen(app_shell);
/* set up work procedure to initialize the rest of the application */
XtAppAddWorkProc (app_context, backgroundProc, (XtPointer)app_shell);
/* now loop around, processing work procedure and events on the popup */
while (NormalRunning != done)
{
XEvent event;
XtAppNextEvent(app_context, &event);
XtDispatchEvent(&event);
}
XtDestroyWidget(popup);
/* Process events, unwrapping correctly. */
while (Quitting != done)
{
XEvent event;
XtAppNextEvent(app_context, &event);
XtDispatchEvent(&event);
}
XtDestroyWidget(app_shell);
XtDestroyApplicationContext(app_context);
exit(0);
}
evolver
Re: Splash Screen Affect...
Thanks a bunch, tolstiy! :)