1. EuGTK - drawing
- Posted by Jerry_Story Oct 09, 2010
- 1071 views
Includes and declarations:
include eugtk_stuff/GtkEngine.e include eugtk_stuff/ListView.e as List include eugtk_stuff/GtkEnums.e include eugtk_stuff/GdkGraphics.e -- etc. object drwColorBand1 = create(GtkDrawingArea), drwColorBand2 = create(GtkDrawingArea) constant style1 = get(drwColorBand1,"style"), style2 = get(drwColorBand2,"style") object canvas1,canvas2,gc1,gc2 canvas1 = peek4u(drwColorBand1 + 52) gc1 = peek4u(style1 + 540) canvas2 = peek4u(drwColorBand2 + 52) gc2 = peek4u(style2 + 540)
Now this should work.
set_foreground(gc1,#FFAA99) set(drwColorBand1,"modify bg",0,"white") clear(canvas1) -- etc. draw_rectangle(canvas1,gc1,TRUE,LP1,y,prot,y + LD) -- These args are valid.
But this happens:
(dmak.exw:25810): Gdk-CRITICAL : gdk_gc_set_foreground: assertion `GDK_IS_GC (gc)' failed
(dmak.exw:25810): Gdk-CRITICAL : gdk_window_clear: assertion `GDK_IS_WINDOW (window)' failed
(dmak.exw:25810): Gdk-CRITICAL : gdk_draw_rectangle: assertion `GDK_IS_DRAWABLE (drawable)' failed
etc.
How are these errors possible?
2. Re: EuGTK - drawing
- Posted by irv Oct 09, 2010
- 1066 views
show_all(win) -- did you do this first? -- can't get the following until a drawing area exists: constant style = get(drawable,"style") canvas = peek4u(drawable + 52) gc = peek4u(style + 540) main()
You have to show() the drawing area before you can get or set anything.