paragui-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-users] Signels ?


From: David Stubbs
Subject: [paragui-users] Signels ?
Date: Mon, 21 Mar 2005 15:42:57 +0000

Hi All,

I have been playing with ParaGUI for two days and it seems wonderful,
the theming is great !. I wanted to use SDL as the underlying layer
but wanted something to make life easier when making my app, after
looking though all of the toolkits ParaGUI seemed like the best one
for me, Although I was a little apprehensive as I've only used C++ a
little but I thought the effort would be worth it.

I'm having a problem trying to link up a click signal from a button to
a member function, I have a test app bellow to illustrate. I would
like to tie the click event from "button" to the member function
"PrintHello" in the instance "t1" of the "Testing" class.  Sorry for
such a basic query just can't figure it out, all help, pointers, tips
or links to any docs or mailing list posts I have missed all greatly
appreciated.

Thanks in advance

     David.

=======================================================
#include "pgapplication.h"
#include "pgbutton.h"
#include <iostream>

class Testing {
public:
        void PrintHello(PG_Button* b);
};

void Testing::PrintHello(PG_Button* b){
        std::cout << "Hello there \n";
};
    
int main() {
        
    PG_Application app;
    

    app.LoadTheme("default");

    Testing t1();
        
    if(!app.InitScreen(800,600, 0, SDL_SWSURFACE)){
        printf("Resolution not supported\n");
        exit(-1);
    }

    // 
    PG_Button button(NULL, PG_Rect(20, 20, 368, 72), "Testing");
    
    // button->sigClick.connect(slot(t1, &Testing::PrintHello));
    
    button.Show();
    
    app.Run();

    return EXIT_SUCCESS;
};
=======================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]