hi,
the tutorial makes this mysterious claim:
http://pike.ida.liu.se/docs/tutorial/oop/access_control.xml
If a class has a constructor (that is, a method called create) it can be
a good idea to declare it static. It is not supposed to be called except
during the construction of the object, and if it is not static there may
be some type incompatibilities in connection with inheritance.
what exactly is that supposed to mean?
i understand the use of static to protect create from access …
[View More]from the
outside, but
what kind of type incompatibilities can there be for inheritance?
and how can static protect against them?
greetings, martin.
[View Less]
hi,
while playing around with modules, i observed the following:
variables in modules are readonly, when accesses directly, and trying to
change them from the outside gives an error.
however trying to change then from the inside is either silently ignored
or succeeds:
int i=7;
string s="foo";
mapping dict = ([ "foo":8 ]);
array list = ({ 5 });
multiset mset = (< "foo" >);
void set(mixed var)
{
// ignored:
i=(int)var;
s[0]=((string)var)[0];
dict += ([ "baz":var ]);
list +=({ …
[View More]var });
list[0] = (int)var;
// succeeds:
dict->foo=var;
dict->bar=var;
mset[var] = 1;
mset += (< var >);
}
shouldn't all of them fail and produce an error?
greetings, martin.
[View Less]
I'm trying to develope my application with Pike and GTK, but when I used
GTK.DrawingArea to draw a line, it doesn't work.
I'm not sure if I misused GTK.DrawingArea, because I can't find example
program that also use DrawingArea
Error message and my code listed below, any suggestion?
It says:
Gdk-CRITICAL **: file gdkgc.c: line 51 (gdk_gc_new_with_values):
assertion `window != NULL' failed.
Gdk-CRITICAL **: file gdkgc.c: line 456 (gdk_gc_set_foreground):
assertion `gc != NULL' failed.
Gdk-…
[View More]CRITICAL **: file gdkdraw.c: line 65 (gdk_draw_line): assertion
`drawable != NULL' failed.
Here is my code:
#!/usr/bin/pike
int main ()
{
GTK.setup_gtk();
GTK.Window MainWin = 0;
GTK.Widget w = GTK.DrawingArea()->set_usize(100,100);
GDK.GC gc = GDK.GC(w)->set_foreground( GDK.Color(255,0,0) );
w->draw_line ( gc , 10 , 10 , 100 , 100 );
MainWin = GTK.Window ( GTK.WINDOW_TOPLEVEL );
MainWin->set_title ( "Testing" );
MainWin->add ( w );
MainWin->show_all();
GTK.main();
return 0;
}
[View Less]
hi,
the webserver on http://pike.ida.liu.se/ seems to be down.
any ideas what's wrong?
the host is reachable, ssh is answering, although i can not log in,
which i could before. that suggests that pike.ida.liu.se is pointing to
a different (or freshly installed) machine.
greetings, martin.