Does anybody have any experience of printing with Gambas3?
My sample code is below and the result is:
Calling .Configure fires the _End event.
Then the _Begin, _Paginate and _Draw events all fire.
Then I get an error "(Test:4193): Gtk-CRITICAL **: 
IA__gtk_print_context_get_cairo_context: assertion `GTK_IS_PRINT_CONTEXT 
(context)' failed"
Then a blank page is printed.
I have tried the sample Print app supplied with Gambas 3 but it was 
written for Gambas1. I'm surprised it even loaded. I cannot find much 
help on the net.
Would appreciate any help.
(Running on Ubuntu 10.10 with gb.gtk and gb.Cairo components).
Regards
Michael

Public myP As New Printer As "myP"
Public Sub Menu2_Click()
    Dim blnOk As Boolean
    If Not myP.Configure() Then
          blnok = myP.Print()
         Paint.Begin(myP)
     Endif
     Catch
         Message.Error(Error.Text)
End
Public Sub myP_Begin()
     myP.count = 1
End
Public Sub myP_Draw()
         Paint.Brush = Paint.Color(Color.Black)
         Paint.Font.Name = "sans serif"
         Paint.Font.Size = 16
         Paint.Text("hello", 300, 300, 600,, Align.Right)
         Paint.End
End
Public Sub myp_End()
    Debug "PRINT END"
End
Public Sub myp_Paginate()
     Debug "Paginate"
End


------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to