[Gambas-user] Setfocus issue

Benoit Minisini gambas at ...1...
Thu Jun 26 11:16:31 CEST 2008


On jeudi 26 juin 2008, Ron wrote:
> Benoit Minisini schreef:
> > On mercredi 25 juin 2008, Ron wrote:
> >> Hi,
> >>
> >> I have a window with 2 Textboxes I want to give focus to TextBox2 upon
> >> loading of the form, if I open the form as a normal window, it's ok.
> >> Textbox2 gets the focus.
> >> If I load the form on a workspace, TextBox2.SetFocus doesn't work.
> >>
> >> See attached example project
> >>
> >> Do I have to reread the docs and shame myself, or should it work the
> >> same way with workspace and normal window?
> >>
> >> Regards,
> >> Ron the 2nd.
> >
> > There were some bugs in both gb.qt, gb.gtk and gb.form.mdi. I fixed them
> > in revision #1433.
>
> Hi,
>
> I just upgraded to #1433, but it doesn't seem to work (when you click
> the "not ok" button) in my example project SetFocus-0.0.1.tar.gz in my
> earlier mail.
>
> Regards,
> Ron the 2nd.
>

Yes, because you call hForm.SetFocus() just after adding it to the Workspace, 
so the SetFocus inside the Open event handler is lost!

-- 
Benoit Minisini




More information about the User mailing list