[Mono-bugs] [Bug 456326] New: TinyGecko.cs converting to TinyGecko.vb

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Dec 4 00:41:25 EST 2008


           Summary: TinyGecko.cs converting to TinyGecko.vb
           Product: Mono: Compilers
           Version: 1.9
          Platform: i686
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Basic
        AssignedTo: rkvinge at novell.com
        ReportedBy: obrigman at nc.rr.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Customer

Tried to convert the TinyGecko.cs example for mono beginners to TinyGecko.vb
for mono-basic beginners!

Here is the code along with the error message:

'This works using "vbnc
'The only thing is if you click the "GO" button, a whole host of compilation
problems occur.
'Most look like this::
' "Exception in Gtk# callback delegate
'  Note: Applications can use GLib.ExceptionManager.UnhandledException to
handle the exception.
'  System.NullReferenceException: Object reference not set to an instance of an
'  at TinyGecko.GoButtonClicked (System.Object obj, System.EventArgs args)
 ' at GLib.Signal.voidObjectCallback (IntPtr handle, IntPtr data) [0x00000]
'  at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean
'  at GLib.Signal.voidObjectCallback(IntPtr handle, IntPtr data)
'  at GLib.Signal.voidObjectCallback(IntPtr , IntPtr )
'  at Gtk.Application.gtk_main()
'  at Gtk.Application.gtk_main()
'  at Gtk.Application.Run()
'  at TinyGecko.Main()

'I also had to re-DIM the Browser As WebControl in the Shared Sub because the
'could not resolve the name 'Browser'! Also when you click the "GO" button the
program disappears!

'Copy this code and see what you get
'To Compile use "vbnc
'Thanks to Roth for this compiler sequence
'Remember to use your own path to your mono directory!

Imports System
Imports Gtk
Imports Gecko

Class TinyGecko

    Shared Sub Main()
          Dim Win As Window 
          Dim GoButton As Button
          Dim StopButton As Button
          Dim entry1 As Entry
          Dim RefButton As Button
          Dim BckButton As Button
          Dim FwdButton As Button
          Dim Frame1 As Frame
          Dim Browser As WebControl
      'Dim URL As String
          Dim vsBox As VBox
          Dim hsBox As HBox

          Win = New Window("TinyGecko")
          GoButton = New Button("GO")
          StopButton = New Button("STOP")
          entry1 = New Entry("Should enter a Url here")
          RefButton = New Button("Refresh")
          BckButton = New Button("Back")
          FwdButton = New Button("Foward")
          Frame1 = New Frame()
          Browser = New WebControl()
          hsBox = New HBox
          vsBox = New VBox
          vsBox.PackStart(hsBox, false, true, 1)
          hsBox.PackEnd(StopButton, false, false, 1)
          hsBox.PackEnd(GoButton, false, false, 1)
          hsBox.PackEnd(entry1, true, true, 1)
          hsBox.PackEnd(RefButton, false, false, 1)
          hsBox.PackEnd(BckButton, false, false, 1)
          hsBox.PackEnd(FwdButton, false, false, 1)
          vsBox.PackStart(Frame1, true, true, 1)
          Win.SetDefaultSize(800, 600)
          AddHandler Win.DeleteEvent, AddressOf WindowDelete
          AddHandler GoButton.Clicked, AddressOf GoButtonClicked
          AddHandler StopButton.Clicked, AddressOf StopButtonClicked
    End Sub

    Shared Sub WindowDelete(ByVal obj As Object, ByVal args As DeleteEventArgs) 
    End Sub

    Shared Sub GoButtonClicked(ByVal obj As Object, ByVal args As EventArgs) 
          Dim Browser As WebControl
    End Sub

    Shared Sub StopButtonClicked(ByVal obj As Object, ByVal args As EventArgs) 
    End Sub

End Class


Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list