Results 1 to 2 of 2

Thread: problem about sig_window_close emitted from CL_DisplayWindow

  1. #1

    Default problem about sig_window_close emitted from CL_DisplayWindow

    hay everyone ...
    i'm trying to solve the problem caused when the user click the close button of the window created using CL_DisplayWindow and nothing happened.

    i have tried to handle the the signal emitted using this line:

    window.sig_window_close().connect( closeButtonClicked );
    where closeButtonClicked is a custom defined function that close the application and release resources.

    but the main problem is that solution doesn't work for me.
    any suggestion?

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    You need to keep the slot reference around:

    Define in your class somewhere a

    CL_Slot slot_window_close;

    and in your connect function, type:

    slot_window_close = window.sig_window_close().connect( closeButtonClicked );

    Note, if you want this to work in a class, you need to connect it like

    slot_window_close = window.sig_window_close().connect(this, &MyClass::closeButtonClicked );


    If you do not keep the slot object around, the signal will disconnect right after the connect.

Similar Threads

  1. CL_DisplayWindow set_size()
    By russ_allegro in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 06-27-2008, 11:53 AM
  2. ClanLib crashes when creating CL_DisplayWindow with target SDL.
    By Otto (Strange) Halmén in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 01-19-2008, 08:38 AM
  3. cl_displaywindow refuses to display a window
    By dwune in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 10-01-2007, 04:01 PM

Bookmarks

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
  •