initialize `background-image` with a resource file



in my gtkmm app i have a label that has a background image thanks to css provider. like this:
```
MainWindow::MainWindow():
Mylabel(Hello)
{
provider = Gtk::CssProvider::create();
provider->load_from_data(
"#LogoLabel{"
//"color:#800000;"
//"color:#5485ae;"
"color:#0075ff;"
"}"
"#PleaseHitKeyLbl{"
"background-color:#3333337a;"
"font-size:20px;"
"}"
"#BackgroundImage{"
"background-image:url(\"file:///home/ali/Desktop/sonbg.jpg\");"
"background-size:100% 100%;"
"opacity:0.3;"
"}"
);
MyLabel.set_name("BackgroundImage");
MyLabel.get_style_context()->add_provider(provider, 1);
}
```
The problem is that I dont know how to tell the `background-image` inside the style provider to "get the image from resource" instead of "file" please help me. 
Regards.


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