Changeset 443

Show
Ignore:
Timestamp:
03/04/2008 00:13:21 (6 months ago)
Author:
why
Message:
  • shoes/app.c: debugged self-closing on gtk. the timers were still going after the window was destroyed. started working on a method to destroy the toplevel slot, which is great since i can start allocation a new slot for every url.
  • lib/shoes.rb: shoes now runs from the directory where a script is located. really, such an obvious omission.
Location:
trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/shoes.rb

    r441 r443  
    194194        Shoes.debug "Loaded SHY: #{shy.name} #{shy.version} by #{shy.creator}" 
    195195        path = shy.launch 
     196      else 
     197        Dir.chdir(File.dirname(path)) 
     198        path = File.basename(path) 
    196199      end 
    197200      eval(File.read(path), TOPLEVEL_BINDING) 
  • trunk/samples/book.rb

    r306 r443  
    77  end 
    88 
    9   INCIDENTS = YAML.load_file('samples/book.yaml') 
     9  INCIDENTS = YAML.load_file('book.yaml') 
    1010 
    1111  def table_of_contents 
  • trunk/shoes/app.c

    r442 r443  
    7272shoes_app_remove(shoes_app *app) 
    7373{ 
     74  shoes_ele_remove_all(app->timers); 
    7475  rb_ary_delete(shoes_world->apps, app->self); 
    7576  return (RARRAY_LEN(shoes_world->apps) == 0); 
     
    19721973shoes_app_close_window(shoes_app *app) 
    19731974{ 
     1975  shoes_ele_remove_all(app->timers); 
    19741976#ifdef SHOES_GTK 
    1975   gtk_widget_destroy(GTK_WIDGET(APP_WINDOW(app))); 
     1977  shoes_app_gtk_quit(app->os.window, NULL, (gpointer)app); 
     1978  gtk_widget_destroy(app->os.window); 
     1979  app->os.window = NULL; 
    19761980#endif 
    19771981#ifdef SHOES_WIN32 
  • trunk/shoes/canvas.c

    r439 r443  
    345345  rb_gc_mark_maybe(canvas->bg); 
    346346  rb_gc_mark_maybe(canvas->contents); 
    347   rb_gc_mark_maybe(canvas->timers); 
    348347  rb_gc_mark_maybe(canvas->click); 
    349348  rb_gc_mark_maybe(canvas->release); 
     
    391390shoes_canvas_empty(shoes_canvas *canvas) 
    392391{ 
    393   if (!NIL_P(canvas->contents)) 
    394   { 
    395     long i; 
    396     VALUE ary; 
    397     ary = rb_ary_dup(canvas->contents); 
    398     for (i = 0; i < RARRAY_LEN(ary); i++)  
    399       rb_funcall(rb_ary_entry(ary, i), s_remove, 0); 
    400     rb_ary_clear(canvas->contents); 
    401   } 
     392  shoes_ele_remove_all(canvas->contents); 
    402393} 
    403394 
     
    12531244  Data_Get_Struct(self, shoes_canvas, self_t); 
    12541245  shoes_canvas_empty(self_t); 
    1255   shoes_canvas_remove_item(self_t->parent, self, 0, 0); 
     1246  if (!NIL_P(self_t->parent)) 
     1247    shoes_canvas_remove_item(self_t->parent, self, 0, 0); 
    12561248  return self; 
    12571249} 
  • trunk/shoes/canvas.h

    r439 r443  
    219219  ID mode; 
    220220  VALUE contents; 
    221   VALUE timers; 
    222221  VALUE parent; 
    223222  VALUE attr; 
  • trunk/shoes/ruby.c

    r435 r443  
    392392  place->ih = place->h - (tmargin + bmargin); 
    393393  INFO("PLACE: (%d, %d), (%d, %d) [%d, %d] %d %x\n", place->x, place->y, place->w, place->h, ABSX(*place), ABSY(*place), place->flags, canvas->marginy); 
     394} 
     395 
     396void 
     397shoes_ele_remove_all(VALUE contents) 
     398{ 
     399  if (!NIL_P(contents)) 
     400  { 
     401    long i; 
     402    VALUE ary; 
     403    ary = rb_ary_dup(contents); 
     404    for (i = 0; i < RARRAY_LEN(ary); i++)  
     405      rb_funcall(rb_ary_entry(ary, i), s_remove, 0); 
     406    rb_ary_clear(contents); 
     407  } 
    394408} 
    395409 
  • trunk/shoes/ruby.h

    r439 r443  
    100100VALUE rb_str_to_pas(VALUE); 
    101101void shoes_place_decide(shoes_place *, VALUE, VALUE, int, int, unsigned char, int); 
     102void shoes_ele_remove_all(VALUE); 
    102103void shoes_cairo_rect(cairo_t *, double, double, double, double, double); 
    103104