Re: Led Widget



Thanks.

In fact, I've found in gtkmm online doc how to do a widget.

I've done everything good but for the expose event.
Here the code :


      Glib::RefPtr<Gdk::GC> gc = Gdk::GC::create(m_refGdkWindow);


     gc->set_background(Gdk::Color("red"));
     //modify_bg(Gtk::STATE_NORMAL , Gdk::Color("red"));
     get_window()->draw_rectangle(gc, true, 0, 0, 10, 10);
     return true;

I would like to set the foreground and background color.
But the "gc->set_background(Gdk::Color("red"));" seems not to work.

I don't quite understand why....







On Wed, Sep 16, 2009 at 19:37, Robert Pearce <rob bdt-home demon co uk> wrote:
On Wed, 16 Sep 2009 18:18:08 +0200 Florent wrote:
>
> I would like to know if there is a little widget to display a led (or
> something)....
>
It's probably not quite what you want, but I created a "labelled lamp" widget, based off a button, for a project I'm doing. You can find it (along with a dial/meter widget) at http://www.bdt-home.demon.co.uk/computer/gtk/gtkdial.zip and a rather crude way to use it within a GTKmm context at http://www.bdt-home.demon.co.uk/computer/gtk/FramedMeter.zip

> If not, is there a tutorial about creating a such widget...?
>
There is a tutorial for creating a plain GTK widget somewhere (uses a basic dial as an example). Not sure about making an MM version.

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



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