Results 1 to 3 of 3

Thread: GUIManager ClanLib 3.0 set_theme

  1. #1

    Default GUIManager ClanLib 3.0 set_theme

    Hello again.

    I was wondering how to access the set theme command shown here: http://clanlib.org/docs/clanlib-3.0/...UIManager.html

    Originally I was starting the gui like so in a function:
    Code:
    clan::GUIManager gui(themeLocation);
    However I'd like to declare it in my classes header then set the theme in the start function: Header -
    Code:
    clan::GUIManager gui;
    and start -
    Code:
    gui.add_theme(themeLocation); gui.set_theme(themeLocation);


    The problem is gui has no set_theme() function for me. And simply using add_theme() throws a runtime error about the Resource Manager not having a cache (I would copypaste but I can't select the text).


    Thanks for the help gents,


    Kyle Rassweiler

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

    Default

    I think that's because...

    The GUI Manager add_theme contains

    Code:
    	XMLResourceManager::get_doc(impl->resources).add_resources(XMLResourceDocument("resources.xml", vfs));
    That assumes that the GUI resources have already been set.

    "clan::GUIManager gui;" does not set the xml resources, thus add_theme does not work.

    A GUI expert needs to look at this to decide the best way of fixing it.

    Maybe adding
    Code:
    "	impl->resources = XMLResourceManager::create(XMLResourceDocument());"
    to the constructor would work?

    I'm not an expert in the area, so I am unsure

  3. #3

    Default

    Thanks for the response.

    I seem to have found a different way of doing it (and it works so far).

    app.h:
    Code:
    clan::GUIManager gui;
    app.cpp:
    Code:
    gui = clan::GUIManager(display_window, theme_location);
    I saw something similar used on another component in one of the examples and gave it a shot. I'm not sure if it's proper but it works.


    Thanks,


    Kyle Rassweiler

Similar Threads

  1. Replies: 0
    Last Post: 04-19-2012, 09:57 PM
  2. ClanLib 2.3.2 Release. ClanLib 2.2.12 Release. Updated Dependencies
    By rombust in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 08-30-2011, 11:08 AM
  3. Replies: 7
    Last Post: 08-26-2008, 09:57 PM
  4. Installing ClanLib 0.8 and ClanLib 0.9 on linux
    By rombust in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 07-15-2008, 09:51 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
  •