Re: [Fwd: Re: How to clear/replace filter list in File Chooser?] Gtk::DrawingArea



On 2/21/07, TheLonelyStar <nabble lonely-star org> wrote:

Thanks for your answer!

My function looks now like this:

Gtk::DrawingArea* tmp=(Gtk::DrawingArea*)refXml->get_widget("DrawingArea");
Glib::RefPtr<Gdk::Window> window(tmp->get_window());

window->draw_arc(tmp->get_style()->get_fg_gc[tmp->get_state()],
                                 TRUE,
                                 0, 0, 550,550,
                                 0, 64 * 360);

Unfortantly I still have problems:

g++ $(pkg-config --libs --cflags gtkmm-2.4) $(pkg-config --libs --cflags
libglademm-2.4) main.cc
main.cc: In function 'bool do_draw(GdkEventExpose*)':
main.cc:31: error: invalid types '<unresolved overloaded function
type>[Gtk::StateType]' for array subscript

Line 31 is the "window->draw_arc" line.


Paul Davis wrote:
>
> On Tue, 2007-02-20 at 14:47 -0800, TheLonelyStar wrote:
>> Hello dear community,
>>
>> I have trouble with Gtk::DrawingArea. Since the class seem to have no
>> more
>> than the gobj() member function, I tried the following (copying from
>> examples I found in the net):
>>
>> bool on_exposure(GdkEventExpose* event)
>> {
>>      Gtk::DrawingArea*
>> tmp=(Gtk::DrawingArea*)refXml->get_widget("DrawingArea");
>>      GtkDrawingArea* da=tmp->gobj();
>>      gdk_draw_arc (da->window,
>>                                da->style->fg_gc[GTK_WIDGET_STATE (da)],
>>                                TRUE,
>>                                0, 0, da->allocation.width, da->allocation.height,
>>                                0, 64 * 360);
>>      return true;
>> }
>
> better:
>
>       Glib::RefPtr<Gdk::Window> window (tmp->get_window());
>       window->draw_arc (tmp->get_style()->fg_gc[tmp->get_state()],
>                           true, ....
>
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>
>

--
View this message in context: http://www.nabble.com/Gtk%3A%3ADrawingArea-tf3263742.html#a9081447
Sent from the Gtkmm mailing list archive at Nabble.com.

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


I think the other Paul might have had a type.  As far as I can tell
fg_gc returns a Gtk::Color object which has no operator[].

Try this:

window->draw_arc(tmp->get_style()->get_fg_gc( tmp->get_state() ),
                                 TRUE,
                                 0, 0, 550,550,
                                 0, 64 * 360);

HTH,
Other Paul Davis



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