Howto:Creating a Font Browser using Nasal and Canvas: Difference between revisions

m
m (https://forum.flightgear.org/viewtopic.php?f=37&t=36946&p=362269#p362269)
Line 27: Line 27:
var window = canvas.Window.new([width,height],"dialog")
var window = canvas.Window.new([width,height],"dialog")
  .set('title',title);
  .set('title',title);
##
# the del() function is the destructor of the Window
# which will be called upon termination (dialog closing)
# you can use this to do resource management (clean up timers, listeners or background threads)
#window.del = func()
#{
#  print("Cleaning up window:",title,"\n");
# explanation for the call() technique at: http://wiki.flightgear.org/Object_oriented_programming_in_Nasal#Making_safer_base-class_calls
#  call(canvas.Window.del, [], me);
#};


# adding a canvas to the new window and setting up background colors/transparency
# adding a canvas to the new window and setting up background colors/transparency