Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <gtkmm.h>
- #include <iostream>
- #include <string>
- int main(int argc, char* argv[])
- {
- auto app = Gtk::Application::create();;
- std::string gladeFile = argv[1];
- auto gladeBuilder = Gtk::Builder::create();
- gladeBuilder->add_from_file(gladeFile);
- app->signal_startup().connect([&]
- {
- for(auto& object: gladeBuilder->get_objects())
- {
- auto widget = Glib::RefPtr<Gtk::Widget>::cast_dynamic(object);
- if(!widget)
- continue;
- auto style = widget->get_style_context();
- auto color = style->get_background_color();
- std::cout<<widget->get_name()<<" "<<color.to_string()<<std::endl;
- }
- });
- app->run();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement