Results 1 to 4 of 4

Thread: MainWindow resizing.....

  1. #1

    Default MainWindow resizing.....

    I'm trying to learn to use ClanLib....
    I'm trying to set a minimum size for the main window (CL_MainWindow) during resizing.
    Looking around the functions, i have noticed the func_resize method (not the func_resized).
    It seem that the func_resize don't work. Or i'm doing something wrong with the code....

    pGUIMainWindow->func_resize().set(this, & TOOL_Main::OnResize);

    void OnResize (CL_Rect & _sRect);

    I can set the my function, but the program simply ignore it. I have already tried to debug, but don't stop at the breakpoint into the function.
    So, i have tried with func_constrain_resize of CL_GUIComponent but i have got a link error.....

    Main.obj : error LNK2001: unresolved external symbol "public: class CL_Callback_v1<class CL_Rect &> & __thiscall CL_GUIComponent::func_constrain_resize(void)" (?func_constrain_resize@CL_GUIComponent@@QAEAAV?$C L_Callback_v1@AAVCL_Rect@@@@XZ)

    Any ideas?

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    Which window manager are you using?

    If I remember correctly only the system WM automatically forwards resize messages from the display window. The other ones require you to hook the sig_resize on CL_DisplayWindow, I think.

  3. #3
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Yes, that is correct.

    Only clanGUI System window manager hooks the window resizing.

    Infact clanGUI System is the only window manager to hook up signals (listed in CL_GUIWindowManagerSite)

    There maybe size effects patching clanGUI so that clanGUI Texture and clanGUI Direct window manager hook the signals.
    And I am not sure if they even should.

    In the future, I would like to see clanGUI split more logically. I am not sure how.

    For example: If you wanted to render a CL_TextEdit component onto a CL_FrameBuffer object, how would you do it?
    (That can be done, but the point is, it's not simple and obvious)

    Anyway...

    If you have access to CL_DisplayWindow, this works:

    Code:
    	window.set_minimum_size(512, 512, false);
    
    	CL_Slot slot_resize = window.sig_resize().connect(this, &Basic2D::on_window_resize);
                   ....
    
    void Basic2D::on_window_resize(int width, int height)
    {
    	
    }

  4. #4

    Default

    Thank you for the reply.
    I didn't see the CL_DisplayWindow::set_minimum_size method.....ehm....

    About the window manager, i used this code....

    pGUIManager = new CL_GUIManager(__tResource);

    It's the window manager that the GUIManager create itself (system window manager, if i remember correctly).

Similar Threads

  1. Replies: 2
    Last Post: 07-14-2011, 04:22 AM

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
  •