how to change the background color of a frame (or this is mission impossible on gtk)
- From: Ofer Oshri <ofer oshri xeround com>
- To: gtkmm-list gnome org
- Subject: how to change the background color of a frame (or this is mission impossible on gtk)
- Date: Sat, 1 Sep 2007 02:05:32 -0700 (PDT)
hi,i am trying to port a qt application to gtkmm. the trivial task of setting the color of a frame became a mission impossible task. here is a simple example of what i am trying to do (on fc6 + kde):
///////////////////////////////////////////////////////////
#include <gtkmm.h>
class window_with_frame : public Gtk::Window {
protected:
Gtk::Frame frame_;
public:
window_with_frame()
{
set_title("frame example");
set_size_request(300, 300);
set_border_width(10);
// change the color of the frame...
Gdk::Color cl("red");
frame_.modify_bg(Gtk::STATE_NORMAL, cl);
add(frame_);
frame_.set_label("frame");
frame_.set_shadow_type(Gtk::SHADOW_ETCHED_OUT);
show_all_children();
}
virtual ~window_with_frame() {}
};
int main(int a, char *b[])
{
Gtk::Main kit(argc, argv);
window_with_frame window;
Gtk::Main::run(window);
return 0;
}
g++ f.cpp -o f `pkg-config gtkmm-2.4 --cflags --libs`
///////////////////////////////////////////////////////////
any advice/help/reference will be appreciated.
ofer.
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]