~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/xdess/twinkle.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function twinkle(h,n)
 
2
 
 
3
[lhs,rhs]=argn(0)
 
4
if rhs==1 then
 
5
  if (type(h)<>9 | size(h,"*")<>1) then
 
6
    error("twinkle: first argument must be a graphics handle")
 
7
  end
 
8
  n=5;
 
9
elseif rhs==2 then
 
10
  if (type(h)<>9 | size(h,"*")<>1) then
 
11
    error("twinkle: first argument must be a graphics handle")
 
12
  end
 
13
  if (type(n)<>1 | size(n,"*")<>1) then
 
14
    error("twinkle: second argument must be an integer")
 
15
  end   
 
16
else
 
17
  error("function ""twinkle"" must have one or two arguments")
 
18
end
 
19
 
 
20
disp("Type of handle: "+h.type);
 
21
 
 
22
f=h;
 
23
while f.type<>"Figure"
 
24
  f=f.parent;
 
25
end
 
26
old_pixmap=f.pixmap;
 
27
f.pixmap="on";
 
28
show_pixmap();
 
29
realtimeinit(0.2); realtime(0);
 
30
k=0;
 
31
if h.type<>"Axes" then
 
32
  v=h.visible;
 
33
  for i=1:n
 
34
    k=k+2;
 
35
    h.visible="off";
 
36
    show_pixmap();
 
37
    realtime(k);
 
38
    h.visible="on";
 
39
    show_pixmap();
 
40
    realtime(k+1);
 
41
  end
 
42
  h.visible=v;
 
43
else
 
44
  v=h.axes_visible;
 
45
  for i=1:n
 
46
    k=k+2;
 
47
    h.axes_visible="off";
 
48
    show_pixmap();
 
49
    realtime(k);
 
50
    h.axes_visible="on";
 
51
    show_pixmap();
 
52
    realtime(k+1);
 
53
  end
 
54
  h.axes_visible=v;
 
55
end
 
56
 
 
57
f.pixmap=stripblanks(old_pixmap);
 
58
 
 
59
endfunction