[Gambas-user] Event in Menu

Rizky Tahara Shita rizky at ...225...
Fri Aug 22 07:53:18 CEST 2003


' Gambas class file
PRIVATE mnuTab AS Object[] 'to store the menu.id's
PRIVATE mnuFile AS Menu

PUBLIC SUB MenuCreating()
DIM hMenu AS Menu
DIM MnuParent AS Object
mnuParent = ME

mnuFile = NEW Menu(MnuParent) AS "MnuFileEvent"
mnuFile.Text = "File"

hMenu = NEW Menu(hMenu) AS "MnuEvent"
hMenu.Text = "Open"
hMenu.Tag = mnuTab.Count
mnuTab.Add(hMenu)

hMenu = NEW Menu(hMenu) AS "MnuEvent"
hMenu.Text = "Quit"
hMenu.Tag = mnuTab.Count
mnuTab.Add(hMenu)

PUBLIC SUB mnexit_Click()
  ME.CLOSE
END

PUBLIC SUB mnuEvent_Click()

SELECT CASE LAST.Tag
    CASE 0
      Dialog.OpenFile
      mnuTab[LAST.Tag].Enabled = FALSE 'This switch the menu open to not 
enabled!
  
    CASE 1
      QUIT

END

yeah that's ok.. may be i miss that space
but now when i compiled again, it still raise error in line 23, that is 
pointed to :

PUBLIC SUB mnexit_Click()


the error is:

"Syntax Error at line 23 in Fmain.class"


what else could be wrong ??


sorry to ask about this all the time.. i just wanna know gambas more and 
more.. 'coz i'm a newbie in gambas and in linux too...

On Wednesday 20 August 2003 20:20, Rob wrote:
> On Wednesday 20 August 2003 04:55, Rizky Tahara Shita wrote:
> > mnuFile = NewMenu(mnuParent) AS "MnuFileEvent"
>
> Typo... needs to be:
>
> mnuFile = New Menu(mnuParent) AS "MnuFileEvent"
>
> Rob
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by Dice.com.
> Did you know that Dice has over 25,000 tech jobs available today? From
> careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
> best hiring companies. http://www.dice.com/index.epl?rel_code4
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list