[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [paragui-users] draw an object on screen - HOW?
From: |
Michael Lüftenegger |
Subject: |
Re: [paragui-users] draw an object on screen - HOW? |
Date: |
Mon, 30 Jun 2003 09:01:49 +0200 |
Hi,
thanks for your answer, but it doesn't work, i tried it. I have no idea why?
misch
----- Original Message -----
From: "Ulf Lorenz" <address@hidden>
To: <address@hidden>
Sent: Sunday, June 29, 2003 10:14 PM
Subject: Re: [paragui-users] draw an object on screen - HOW?
On Fri, Jun 27, 2003 at 11:12:39PM +0200, Michael Lüftenegger wrote:
> <---------------------------------- code beginn>
> #include "SDL\SDL.h"
> #include "pgapplication.h"
> #include "pgbutton.h"
>
> class gol{
> public:
> PG_Widget *screen;
>
> gol(){
> screen = NULL;
> }
>
> void mydraw(){
> Uint8 R =255;
> // SHOULD DRAW A RECT_OBJECT, BUT IT DOESN'T WORK!!
> // WHY??
> screen->DrawRectWH (10,10,100,100,R,R,R);
> screen->Update();
You aren't missing a "screen->Show()", are you?
> }
> };
>
> // Eventhandler
> // Button_step
> PARAGUI_CALLBACK(step_handler) {
> gol *app = (gol*) clientdata;
> app->mydraw();
> return true;
> }
>
> int main(int argc, char* argv[]) {
> PG_Application app;
> app.LoadTheme("default");
> app.InitScreen(800, 600, 16, SDL_SWSURFACE);
> app.SetEmergencyQuit(true);
> // WIDGET TO DRAW IN.
> PG_Widget mywid(NULL,PG_Rect(10,35,600,360));
> // gol
> gol mygol;
> mygol.screen = &mywid;
> // Button start/stop
> PG_Button B_start_stop(NULL, 1,PG_Rect(650, 35, 100, 30),"step");
> B_start_stop.SetEventCallback(MSG_BUTTONCLICK, step_handler,
&mygol);
> B_start_stop.Show();
> app.Run();
> return 0;
> }
> <---------------------------------- code end>
Ulf
--
Never age. Never die. Live for ever in that one last white-hot moment, when
the
crowd screamed. When every note was a heartbeat. Burn across the sky.
You will never grow old. They will never say you died.
(Soul Music)
_______________________________________________
paragui-users mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/paragui-users