Professional Web Applications Themes

Splash Screen N simple alert box - Mac Programming

Hello 1) does anyone try to create a splash screen with a PICT resource before? 2) I need a simple alert box with Cancel and OK button. So i can ask "You sure to quit?" and check for ok and cancel. Thanks... -- Best Regards Eleen...

  1. #1

    Default Splash Screen N simple alert box

    Hello

    1) does anyone try to create a splash screen with a PICT resource before?

    2) I need a simple alert box with Cancel and OK button.
    So i can ask "You sure to quit?" and check for ok and cancel.

    Thanks...

    --
    Best Regards
    Eleen


    neele Guest

  2. #2

    Default Re: Splash Screen N simple alert box

    > 1) does anyone try to create a splash screen with a PICT resource before? 

    Cocoa, Carbon, Applescript,...? MB.
    M Guest

  3. #3

    Default Re: Splash Screen N simple alert box

    carbon programming.
    thanks

    --
    Best Regards
    Eleen
    "M" <com> wrote in message
    news:1g5tqwm.aas74wq5bd1gN%com... [/ref]
    before? 
    >
    > Cocoa, Carbon, Applescript,...? MB.[/ref]


    neele Guest

  4. #4

    Default Re: Splash Screen N simple alert box

    In article <br9ifk$eqa$singnet.com.sg>,
    "neele" <com> wrote:
     

    Here is one way to do it. This just waits for any mouse click.

    STD_RSRCID is the recource id of the pict resource,
    adn SPLASHWINDOWID is that of the window resource.
    The version of the app is written on the window.

    void DoAboutBox()
    {
    WindowPtr splash;
    MouseTrackingResult outResult;
    Point thePt;
    Boolean finished = false;

    SetPortWindowPort(splash =
    GetNewCWindow(SPLASHWINDID,0L,(WindowPtr)-1L));
    PicHandle splashPict = GetPicture(STD_RSRCID);

    Rect portRect;
    GetWindowPortBounds(splash,&portRect);
    HNoPurge((Handle)splashPict);
    DrawPicture(splashPict,&portRect);
    HPurge((Handle)splashPict);

    TextSize(14);
    TextFace(bold);
    TextFont(kFontIDTimes);
    RGBForeColor(&WHITE);
    MoveTo(portRect.left+10,portRect.top+100);
    VersRecHndl theVersion = (VersRecHndl)Get1IndResource('vers',1);
    DrawString((**theVersion).shortVersion);
    ReleaseResource((Handle)theVersion);

    Show(splash);
    do
    {
    TrackMouseLocation(GetWindowPort(splash), &thePt, &outResult);
    switch(outResult)
    {
    case kMouseTrackingMouseDown:
    case kMouseTrackingMouseUp:
    finished = true;
    break;

    }
    }while(!finished);

    DisposeWindow(splash);
    ReleaseResource((Handle)splashPict);
    }

    --
    James Meiss
    <http://amath.colorado.edu/faculty/jdm>
    James Guest

  5. #5

    Default Re: Splash Screen N simple alert box

    Hello

    THANKS :) your splash screen code works !!
    but there is few qn i want to ask ask i having compilf error.
    I commented that out.

    RGBForeColor(&WHITE); //WHITE not define
    DrawString((**theVersion).shortVersion); //Cos me error...think some
    exception

    Show(splash); i change to ShowWindow(splash);


    If it is Possible, can u kindly explain a little of the code...
    you provided. As I use it but does not means i fully understand
    ;c ...

    Thanks. a lot !!

    --
    Best Regards
    Eleen
    "James Meiss" <invalid> wrote in message
    news:colorado.edu... [/ref]
    before? 
    >
    > Here is one way to do it. This just waits for any mouse click.
    >
    > STD_RSRCID is the recource id of the pict resource,
    > adn SPLASHWINDOWID is that of the window resource.
    > The version of the app is written on the window.
    >
    > void DoAboutBox()
    > {
    > WindowPtr splash;
    > MouseTrackingResult outResult;
    > Point thePt;
    > Boolean finished = false;
    >
    > SetPortWindowPort(splash =
    > GetNewCWindow(SPLASHWINDID,0L,(WindowPtr)-1L));
    > PicHandle splashPict = GetPicture(STD_RSRCID);
    >
    > Rect portRect;
    > GetWindowPortBounds(splash,&portRect);
    > HNoPurge((Handle)splashPict);
    > DrawPicture(splashPict,&portRect);
    > HPurge((Handle)splashPict);
    >
    > TextSize(14);
    > TextFace(bold);
    > TextFont(kFontIDTimes);
    > RGBForeColor(&WHITE);
    > MoveTo(portRect.left+10,portRect.top+100);
    > VersRecHndl theVersion = (VersRecHndl)Get1IndResource('vers',1);
    > DrawString((**theVersion).shortVersion);
    > ReleaseResource((Handle)theVersion);
    >
    > Show(splash);
    > do
    > {
    > TrackMouseLocation(GetWindowPort(splash), &thePt, &outResult);
    > switch(outResult)
    > {
    > case kMouseTrackingMouseDown:
    > case kMouseTrackingMouseUp:
    > finished = true;
    > break;
    >
    > }
    > }while(!finished);
    >
    > DisposeWindow(splash);
    > ReleaseResource((Handle)splashPict);
    > }
    >
    > --
    > James Meiss
    > <http://amath.colorado.edu/faculty/jdm>[/ref]


    neele Guest

  6. #6

    Default Re: Splash Screen N simple alert box

    Thanks for ur reply.

    But i would like to check something,
    there is a Window Resource. Does it means i must
    create a WIND in RESEDIT??..
    sorry am rather new..and novice in all these..

    So if i am not wrong, i should create a WIND n PICT resource
    then copy and place the code below. And by right it will show a splash
    screen
    is that so?

    Hope to hear from U..
    Thanks.

    Best Regards
    Eleen

    --
    Best Regards
    Eleen
    "James Meiss" <invalid> wrote in message
    news:colorado.edu... [/ref]
    before? 
    >
    > Here is one way to do it. This just waits for any mouse click.
    >
    > STD_RSRCID is the recource id of the pict resource,
    > adn SPLASHWINDOWID is that of the window resource.
    > The version of the app is written on the window.
    >
    > void DoAboutBox()
    > {
    > WindowPtr splash;
    > MouseTrackingResult outResult;
    > Point thePt;
    > Boolean finished = false;
    >
    > SetPortWindowPort(splash =
    > GetNewCWindow(SPLASHWINDID,0L,(WindowPtr)-1L));
    > PicHandle splashPict = GetPicture(STD_RSRCID);
    >
    > Rect portRect;
    > GetWindowPortBounds(splash,&portRect);
    > HNoPurge((Handle)splashPict);
    > DrawPicture(splashPict,&portRect);
    > HPurge((Handle)splashPict);
    >
    > TextSize(14);
    > TextFace(bold);
    > TextFont(kFontIDTimes);
    > RGBForeColor(&WHITE);
    > MoveTo(portRect.left+10,portRect.top+100);
    > VersRecHndl theVersion = (VersRecHndl)Get1IndResource('vers',1);
    > DrawString((**theVersion).shortVersion);
    > ReleaseResource((Handle)theVersion);
    >
    > Show(splash);
    > do
    > {
    > TrackMouseLocation(GetWindowPort(splash), &thePt, &outResult);
    > switch(outResult)
    > {
    > case kMouseTrackingMouseDown:
    > case kMouseTrackingMouseUp:
    > finished = true;
    > break;
    >
    > }
    > }while(!finished);
    >
    > DisposeWindow(splash);
    > ReleaseResource((Handle)splashPict);
    > }
    >
    > --
    > James Meiss
    > <http://amath.colorado.edu/faculty/jdm>[/ref]


    neele Guest

  7. #7

    Default Re: Splash Screen N simple alert box

    On Mon, 15 Dec 2003, neele wrote:
     
    I have explained some of it briefy below.
    Fred
     [/ref]
    > before? 
    > >
    > > Here is one way to do it. This just waits for any mouse click.
    > >
    > > STD_RSRCID is the recource id of the pict resource,
    > > adn SPLASHWINDOWID is that of the window resource.
    > > The version of the app is written on the window.
    > >
    > > void DoAboutBox()
    > > {
    > > WindowPtr splash;
    > > MouseTrackingResult outResult;
    > > Point thePt;
    > > Boolean finished = false;
    > >
    > > SetPortWindowPort(splash =
    > > GetNewCWindow(SPLASHWINDID,0L,(WindowPtr)-1L));[/ref][/ref]
    load the specified window. the -1 bit makes it be in front of other
    windows, the SetPortWindowPort make the new window the current window for
    drawing and so on.

     [/ref]
    load the picture [/ref]
    get the rectangle that bounds the port. [/ref]
    make sure the memory manager won't do anything horrible to the pciture
    (this isn't needed on os X) [/ref]
     [/ref]
    sets up text properties. WHITE should be a variable of type RGBColor
    with each component set to 65535.
     [/ref]
    this assumes that your application has a vers resource with id 1 (which it
    should if it's not a bundled application [/ref]
    one of the fields of the version resource is a string with your app's
    version (ie "1.2.3"). You could of course subsitute any string here if you
    wanted to show other info. [/ref]
    show the window. [/ref]
    track mouse location runs the event loop and lets you know when
    interesting things happen.
     [/ref]
    clean up. 
    >
    >
    >[/ref]

    Frederick Guest

  8. #8

    Default Re: Splash Screen N simple alert box

    Thanks ! for the explanation.
    I get clearer of what it is doing.

    Now i need a slight change, instead of tracking
    the mouse clicked, is there some simple code
    like Wait(100); or Sleep(100); ?? like let
    the splash screen show for 10 seconds and
    disappear...

    Thanks

    --
    Best Regards
    Eleen
    "Frederick Cheung" <DUH.ucam.org> wrote in message
    news:srcf.societies.cam.ac.uk... 
    > I have explained some of it briefy below.
    > Fred

    > > before? [/ref]
    > load the specified window. the -1 bit makes it be in front of other
    > windows, the SetPortWindowPort make the new window the current window for
    > drawing and so on.
    >
    > [/ref]
    > load the picture [/ref]
    > get the rectangle that bounds the port. [/ref]
    > make sure the memory manager won't do anything horrible to the pciture
    > (this isn't needed on os X) [/ref]
    > [/ref]
    > sets up text properties. WHITE should be a variable of type RGBColor
    > with each component set to 65535.
    > [/ref]
    > this assumes that your application has a vers resource with id 1 (which it
    > should if it's not a bundled application [/ref]
    > one of the fields of the version resource is a string with your app's
    > version (ie "1.2.3"). You could of course subsitute any string here if you
    > wanted to show other info. [/ref]
    > show the window. [/ref]
    > track mouse location runs the event loop and lets you know when
    > interesting things happen.
    > [/ref]
    > clean up. 
    > >
    > >
    > >[/ref]
    >[/ref]


    neele Guest

  9. #9

    Default Re: Splash Screen N simple alert box

    In article <brjt1r$d2n$singnet.com.sg>,
    "neele" <com> wrote:
     

    Sorry about that. I should have included

    const RGBColor WHITE = {-1,-1,-1};

    and said you had to include a 'vers' resource with resource id 1 as well
    in your application for the version thing to work.

    Thanks to Fred for explaining some of my code in his message!

    --
    James Meiss
    <http://amath.colorado.edu/faculty/jdm>
    James Guest

  10. #10

    Default Re: Splash Screen N simple alert box

    thanks.

    I got a compile error now when i compile for Classic OS
    TrackMouseLocation( CGrafPort *, Point *, unsigned short *) does not match
    ....

    TrackMouseLocation(GetWindowPort(splash), &thePt, &outResult);

    Hmmm in OS X is running fine. How should i correct the error??
    Thanks
    --
    Best Regards
    Eleen
    "James Meiss" <invalid> wrote in message
    news:colorado.edu... 
    >
    > Sorry about that. I should have included
    >
    > const RGBColor WHITE = {-1,-1,-1};
    >
    > and said you had to include a 'vers' resource with resource id 1 as well
    > in your application for the version thing to work.
    >
    > Thanks to Fred for explaining some of my code in his message!
    >
    > --
    > James Meiss
    > <http://amath.colorado.edu/faculty/jdm>[/ref]


    neele Guest

  11. #11

    Default Re: Splash Screen N simple alert box

    In article <brm01h$ch4$singnet.com.sg>,
    "neele" <com> wrote:
     

    man 3 sleep


    Simon Guest

  12. #12

    Default Re: Splash Screen N simple alert box

    Sorry what u mean by man 3 sleep??
    u mean code

    man 3 sleep; ?? not working...do i need any include file?

    --
    Best Regards
    Eleen
    "Simon Slavin" <demon.co.uklocalhost> wrote in message
    news:0.1.2... 
    >
    > man 3 sleep
    >
    >[/ref]


    neele Guest

  13. #13

    Default Re: Splash Screen N simple alert box

    On Fri, 19 Dec 2003, neele wrote:
     
    He meant type "man 3 sleep" into a terminal window (to view the section3
    manpage on sleep)

    Fred
     
    > >
    > > man 3 sleep
    > >
    > >[/ref]
    >
    >
    >[/ref]

    Frederick Guest

  14. #14

    Default Re: Splash Screen N simple alert box

    In article
    <srcf.societies.cam.ac.uk>,
    Frederick Cheung <DUH.ucam.org> wrote:
     
    > He meant type "man 3 sleep" into a terminal window (to view the section3
    > manpage on sleep)[/ref]

    He's also giving bad advice, as calling sleep will prevent carbon even handlers
    from being called and will cause the spinning pizza to show up, which is poor.
    The right answer here is to install a carbon timer and close the window from
    that timer.

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

  15. #15

    Default Re: Splash Screen N simple alert box

    Thanks for the reply

    I need to check as my application must work for PPC and OS X
    does the below only applicable to OS X??
     
    from 

    Where can i find the sample code?
    Thanks once again !

    --
    Best Regards
    Eleen
    "Miro Jurisic" <org> wrote in message
    news:mit.edu... 
    > > He meant type "man 3 sleep" into a terminal window (to view the section3
    > > manpage on sleep)[/ref]
    >
    > He's also giving bad advice, as calling sleep will prevent carbon even[/ref]
    handlers 
    poor. 
    from 


    neele Guest

  16. #16

    Default Re: Splash Screen N simple alert box

    On Mon, 22 Dec 2003, neele wrote:
     
    EventLoopTimers will run if you have Carbon, i think that the early
    versions of CarbonLib that ran on 8.1 don't have it though (so you could
    be restricting yourself to 8.6 or higher
     
    > from 
    >
    > Where can i find the sample code?
    > Thanks once again !
    >[/ref]
    static pascal void MyCloseWindowTimer(EventLoopTimerRef r,void *userData){
    ReleaseWindow((WindowRef)userData);
    }

    InstallEventLoopTimer(GetMainEventLoop(),10*kEvent DurationSecond,0,NewEventLoopTimerUPP(MyCloseWindo wTimer),myWindow);

    This installs a timer that will fire in ten seconds. (The event loop does
    need to be running for this to work (via RunApplicationEventLoop or
    WaitNextEvent for example)).

    Fred

     
    > >
    > > He's also giving bad advice, as calling sleep will prevent carbon even[/ref]
    > handlers 
    > poor. 
    > from 
    >
    >
    >[/ref]

    Frederick Guest

  17. #17

    Default Re: Splash Screen N simple alert box

    Hello Frederick

    I tried the sample code.
    But having some function call error.
    Do i need to include any header files??

    I simply use the CODE with the splash screen code.
    Do i need to declare InstallEventLoopTimer function??

    And i check out InstallEventLoopTimer..it seem only able to run on OS X and
    above?
    How about PPC ?
     
    InstallEventLoopTimer(GetMainEventLoop(),10*kEvent DurationSecond,0,NewEventL
    oopTimerUPP(MyCloseWindowTimer),myWindow); 

    Thanks

    --
    Best Regards
    Eleen
    "Frederick Cheung" <DUH.ucam.org> wrote in message
    news:srcf.societies.cam.ac.uk... 
    > EventLoopTimers will run if you have Carbon, i think that the early
    > versions of CarbonLib that ran on 8.1 don't have it though (so you could
    > be restricting yourself to 8.6 or higher

    > > from 
    > >
    > > Where can i find the sample code?
    > > Thanks once again !
    > >[/ref]
    > static pascal void MyCloseWindowTimer(EventLoopTimerRef r,void *userData){
    > ReleaseWindow((WindowRef)userData);
    > }
    >
    >[/ref]
    InstallEventLoopTimer(GetMainEventLoop(),10*kEvent DurationSecond,0,NewEventL
    oopTimerUPP(MyCloseWindowTimer),myWindow); [/ref][/ref]
    <srcf.societies.cam.ac.uk>, [/ref][/ref]
    section3 
    > > handlers [/ref][/ref]
    is [/ref][/ref]
    window 
    > >
    > >
    > >[/ref]
    >[/ref]


    neele Guest

  18. #18

    Default Re: Splash Screen N simple alert box

    On Mon, 22 Dec 2003, neele wrote:
     
    CarbonEvents.h (or just Carbon/Carbon.h if you have a Mach-O project 
     
    If you read the headers it says:
    * Availability:
    * Non-Carbon CFM: not available
    * CarbonLib: in CarbonLib 1.1 and later
    * Mac OS X: in version 10.0 and later
    */

    So no, you don't need os X 
    > InstallEventLoopTimer(GetMainEventLoop(),10*kEvent DurationSecond,0,NewEventL
    > oopTimerUPP(MyCloseWindowTimer),myWindow); 
    >
    > Thanks
    >
    > --
    > Best Regards
    > Eleen
    > "Frederick Cheung" <DUH.ucam.org> wrote in message
    > news:srcf.societies.cam.ac.uk... 
    > > EventLoopTimers will run if you have Carbon, i think that the early
    > > versions of CarbonLib that ran on 8.1 don't have it though (so you could
    > > be restricting yourself to 8.6 or higher
    > > 
    > > static pascal void MyCloseWindowTimer(EventLoopTimerRef r,void *userData){
    > > ReleaseWindow((WindowRef)userData);
    > > }
    > >
    > >[/ref]
    > InstallEventLoopTimer(GetMainEventLoop(),10*kEvent DurationSecond,0,NewEventL
    > oopTimerUPP(MyCloseWindowTimer),myWindow); [/ref]
    > <srcf.societies.cam.ac.uk>, [/ref]
    > section3 [/ref]
    > is [/ref]
    > window 
    > >[/ref]
    >
    >
    >[/ref]

    Frederick Guest

  19. #19

    Default Re: Splash Screen N simple alert box

    In article <bs6i3o$k1q$singnet.com.sg>,
    "neele" <com> wrote:
     

    PPC is the name of a processor, not an OS. The PPC can run either OS 9
    or OS X, in general. I think you mean to say that you need to be able
    to run on OS X and OS 9, right?
    Sean Guest

  20. #20

    Default Re: Splash Screen N simple alert box

    Thanks

    yes Sean McBride is right. Sorry i am asking
    whether the code can work on OS 9 and OS X.
    So since it is able to work on on OS X what about OS 9?

    --
    Best Regards
    Eleen
    "Frederick Cheung" <DUH.ucam.org> wrote in message
    news:srcf.societies.cam.ac.uk... 
    > CarbonEvents.h (or just Carbon/Carbon.h if you have a Mach-O project 
    > [/ref]
    and 
    > If you read the headers it says:
    > * Availability:
    > * Non-Carbon CFM: not available
    > * CarbonLib: in CarbonLib 1.1 and later
    > * Mac OS X: in version 10.0 and later
    > */
    >
    > So no, you don't need os X [/ref][/ref]
    *userData){ 
    > >[/ref][/ref]
    InstallEventLoopTimer(GetMainEventLoop(),10*kEvent DurationSecond,0,NewEventL 
    > >
    > > Thanks
    > >
    > > --
    > > Best Regards
    > > Eleen
    > > "Frederick Cheung" <DUH.ucam.org> wrote in message
    > >[/ref][/ref]
    news:srcf.societies.cam.ac.uk... [/ref][/ref]
    could [/ref][/ref]
    window [/ref][/ref]
    *userData){ 
    > >[/ref][/ref]
    InstallEventLoopTimer(GetMainEventLoop(),10*kEvent DurationSecond,0,NewEventL [/ref][/ref]
    does 
    > >[/ref][/ref]
    <srcf.societies.cam.ac.uk>, 
    > > section3 [/ref][/ref]
    even [/ref][/ref]
    which 
    > > window 
    > >
    > >
    > >[/ref]
    >[/ref]


    neele Guest

Page 1 of 2 12 LastLast

Similar Threads

  1. Splash Screen b4 DataGrid
    By Paul King in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: August 25th, 01:19 PM
  2. Splash Screen While Loading?
    By LordCeleborn in forum Macromedia Director Basics
    Replies: 6
    Last Post: June 17th, 06:47 PM
  3. Splash Screen
    By Michael_Siersema@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 0
    Last Post: April 23rd, 07:14 PM
  4. AI 10 Stuck on splash screen
    By Brian_Frank@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 9
    Last Post: February 23rd, 04:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139