Well, firstly I'm very glad for all the indications that I receive from =
everybody.If it was possible I will pay a beer to everybody.....or more =
than one in more than one case :)
>$win->btnHide()->SetFocus(); #fails on run-time, btnHide?
I'm going to include the event that is sorrounding my head ...this is an =
event that comes from a TreeView, I comment some thinks in bold ,that =
is:=20
sub Tree_NodeClick
{
$posdinsalu=3D0;
for my $est_alu (@alumne)
{
if ($est_alu->{Arbre}=3D=3D$_[0])
{
if (!exists ($w_analisi[$posdinsalu]))
{
# I Create dinamically a window that depens on a variable
$w_analisi[$posdinsalu] =3D Win32::GUI::Window->new (
-top =3D> 0,
-left =3D> 0,
-width =3D> 600,=20
-height =3D> 400,
-minsize =3D> [600,400],
-text =3D> "Comentaris respecte $est_alu->{Nom}",=20
-name =3D> "Mailtool::tutor::e_w_analisi_$posdinsalu",);
$canviat[$posdinsalu]=3D0;
=20
open ENTSIS,"<sessions/${posdinsalu}${noms}.txt";
=20
$res =3D<ENTSIS>;
chop ($res);
$toteltex=3D$res;
while($res =3D<ENTSIS>)
{
chop ($res);
$toteltex=3D$toteltex."\r\n".$res;
}
close ENTSIS;
$comentaris[$posdinsalu] =3D$w_analisi[$posdinsalu]->AddTextfield(
-foreground =3D> [0, 0, 0], # Color del text: negre
-font =3D> $Mailtool::mevesfonts::fo_normal,
-left =3D> 10,
-top =3D> 10,
-height =3D> 350,
-width =3D> 480,
-name =3D> "Mailtool::tutor::t_comentari_$posdinsalu",
-addstyle =3D> WS_CHILD | WS_VISIBLE | WS_VSCROLL=20
| ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL,);
$comentaris[$posdinsalu]->Text("${toteltex}");
$b_guardar[$posdinsalu] =3D $w_analisi[$posdinsalu]->AddButton(
-text =3D> "GUARDAR", # Text al bot=F3
-font =3D> $Mailtool::mevesfonts::fo_normal,
-left =3D> 510,
-top =3D> 85,
-height =3D> 25,
-name =3D> "Mailtool::tutor::b_$posdinsalu",);
## Ens cal fer us de eval per al tractament dels events de les =
finestres din=E0miques.
## Aldo told me about the use of eval....it works good
eval qq{ =20
sub Mailtool::tutor::b_${posdinsalu}_Click {
Mailtool::tutor::b_Click($posdinsalu);}
=20
sub Mailtool::tutor::e_w_analisi_${posdinsalu}_Terminate {
Mailtool::tutor::e_w_analisi_Terminate($posdinsalu);}
=20
sub Mailtool::tutor::t_comentari_${posdinsalu}_Change {
Mailtool::tutor::t_comentari_Change($posdinsalu);}
};
# Here stars the problem, the new windows appears for miliseconds but =
goes beneath the $w_tutor
$w_analisi[$posdinsalu]->Show();
$w_analisi[$posdinsalu]->SetForegroundWindow();
$w_analisi[$posdinsalu]->SetFocus();
}
else
{
# In case that I reopen a dinamic window the first time it doesn't =
open, but yes the next time, after another one, for example
$w_analisi[$posdinsalu]->Show();
}=20
} =20
}
return 0;
}
A lot of thaks to everybody !!!
Regards from Catalonia,
Guillem Cunillera i Wefers "Cuni"
|