Why does not work?

11 views
Skip to first unread message

Pasquale Frega

unread,
Mar 13, 2016, 1:53:13 PM3/13/16
to Hecl
proc hello {} {
alert {Hello};
}

[activity] settitle {Hello};
set _layoutparams [linearlayoutparams -new {FILL_PARENT WRAP_CONTENT}];
set _layout [linearlayout -new [activity] -layoutparams $_layoutparams];
$_layout setorientation VERTICAL;

set _scroll [scrollview -new [activity] -layoutparams $_layoutparams];
$_scroll addview $_layout;
[activity] setcontentview $_scroll;

$_layout addview [textview -new [activity] -text "Hello, this is a test.\n" -layoutparams $_layoutparams];

set _button [button -new [activity] -text {Click me} -layoutparams $_layoutparams -onclicklistener [callback -new [list [list hello]]]];
$_layout addview $_button;

Pasquale Frega

unread,
Mar 15, 2016, 5:31:02 PM3/15/16
to Hecl
I think in this case the proc hello has to get an unsed argument, something like this should
be solve:

proc hello {from_button} {
...
}

Reply all
Reply to author
Forward
0 new messages