Event of a control's property...

Post

Posted
Rating:
#1 (In Topic #1344)
Regular
chrisRoald is in the usergroup ‘Regular’
Hi, this has likely been asked before, but how do I code for an event-subroutine of a control's property?…

My form's fileChooser control has a property fileView, which can trigger a 'menu' event - right-mouse-click for popup menu. But I get a compileError if I code:-

Code (gambas)

  1. Sub fileChooser1.fileview_menu()
  2.     print "stuff here"

this naming of an event subroutine doesn't work either? - never gets called!

Code (gambas)

  1. Sub fileChooser1_fileview_menu()

How do I name an event subroutine for a control's property object??

Many thanks,
chrisR
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
By default you can only get the FileChooser1_ events.
You cannot access the FileChooser internal FileView events through FileChooser in any way.

But you can create an Observer for the FileView

Code (gambas)

  1.  
  2. Public Sub Form_Open()
  3.  
  4.   Dim hObs As Observer = New Observer(FileChooser1.FileView) As "OBS"
  5.  
  6.  
  7. Public Sub OBS_Menu()
  8.  
  9.   Print "Menu event"
  10.  
  11.  
  12.  
Online now: No Back to the top
1 guest and 0 members have just viewed this.