[Gambas-user] prb:event programming

Benoit Minisini benoit.minisini at ...2...
Thu Apr 27 18:02:33 CEST 2006


On Thursday 27 April 2006 14:59, ron wrote:
> I have a form Fnavbar
>
> 4 buttons in group
> -------------------------
> ' Gambas class file
> EVENT DoNavigation(sBtnTag AS String)
>
> PUBLIC SUB _new()
>   ME.Show
>   timernavbtn = ""
>   TimerLock = FALSE
> END
>
> PUBLIC SUB Navigation_Click()
>   DIM ta AS String
>   ta = LAST.tag
>   PRINT "you clicked:" & ta <-- this works correct
>   RAISE DoNavigation("ta") <-- does not raise event
> END
>
> ' below works for read/write
> PRIVATE SUB Position_write(Position AS Integer)
>   txtPos.Text = Position
>   IF position = 4 THEN RAISE DoNavigation("pre") <-- this works not
> END
> PRIVATE FUNCTION Position_read() AS Integer
>   RETURN txtPos.Text
> END
> PRIVATE SUB Total_write(Total AS Integer)
>   txtTotal.Text = Total
> END
> PRIVATE FUNCTION Total_read() AS Integer
>   RETURN txtTotal.Text
> END
> ----------------------------------
>
> the main form
>
> PRIVATE NavBar AS Fnavbar
>
> STATIC PUBLIC FUNCTION Run() AS Boolean
>
>   DIM hForm AS Form
>
>   hForm = NEW Form1
>   RETURN hForm.ShowModal()
>
> END
>
> PUBLIC SUB _new()
>   NavBar = NEW Fnavbar AS "Browser"
> END
>
> PUBLIC SUB Browser_DoNavigation(sBtnTag AS String)
>   TimerNavBtn = ""
>   DoNavigation(sBtnTag)
> END
>
> ---------------------------------
> I found an example on a german wiki and created that one.
> http://de.wikibooks.org/wiki/Gambas:_Event
> at the bottom the example.
>
> The event works here but it is a class that raise the event.
> I try it from a form class.
>
> Where to look for wrong thing?
>

You must tell which version of Gambas you use, and send me your project so 
that I can check what happens, and eventually fix the bug if there is a bug!

Regards,

-- 
Benoit Minisini





More information about the User mailing list