1. EuGTK - drawing

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?

new topic     » topic index » view message » categorize

2. Re: EuGTK - drawing

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.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu