Re: colors of labels in event boxes



On 8/2/06, Martin Spurek <martin spurek fei vsb cz> wrote:
I got today again to this my problem with colors. So i created such testcase
without using libglade (btw in previous configuration it was working all
together) and the label still does not take the color as i expect.
martin

Quoting Murray Cumming <murrayc murrayc com>:
> Please try creating a test case that doesn't use libglademm. Then you
> will know whether the problem is in libglade.


#include <gtkmm.h>
// #include <libglademm.h>

class TestWindow;

class TableLine{
        public:
                TableLine(TestWindow* tw, Gtk::VBox* vboxIntx);
        protected:
                Gtk::EventBox* m_EventBox1;
        private:
                Gtk::VBox* vboxInt;
                Gtk::Label* interfaceL;
};

TableLine::TableLine(TestWindow* tw, Gtk::VBox* vboxIntx){
        vboxInt=vboxIntx;
        m_EventBox1 = new Gtk::EventBox();
        interfaceL = new Gtk::Label("none detected");
        m_EventBox1->add(*interfaceL);
        vboxInt->pack_start(*m_EventBox1);
        m_EventBox1->show();
        interfaceL->show();

        m_EventBox1->modify_bg(Gtk::STATE_NORMAL, Gdk::Color("yellow"));

}

class TestWindow: public Gtk::Window {
        public:
                TestWindow();
        private:
                Gtk::VBox* m_Box;
                TableLine* t_line;
};

TestWindow::TestWindow(){
        set_title("GUI for GTK");
        set_default_size(500,300);
        Gtk::Frame* pFrame = 0;
        pFrame = new Gtk::Frame("top frame");
        add(*pFrame);

        m_Box = new Gtk::VBox(true,0);
        pFrame->add(*m_Box);

        // add a line into the ...
        TableLine* tl =  new TableLine(this, m_Box);

        show_all_children();
}

int main (int argc, char *argv[]){
        Gtk::Main kit(argc, argv);
        TestWindow tw;
        kit.run(tw);
        return 0;
}

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


The label is bright yellow for me using gtkmm 2.8.8 on ubuntu dapper
(I assume yellow is the desired result).  Have you tried changing your
gtk theme and seeing if that makes a difference?

--
jonner



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