On-the-fly dialogs in LO Calc - text size on buttons?

I am writing some On the fly dialogs - ie not using the graphical dialog editor - and have discovered by much reading and searching how to edit the TextColor of buttons, and BackgroundColor of the dialogs e.g.

oDialogModel= createUnoService( “com.sun.star.awt.UnoControlDialogModel” )
oDialogModel.BackgroundColor = RGB (0,0,255)

and

oButtonModel = oDialogModel.createInstance( “com.sun.star.awt.UnoControlButtonModel” )
oButtonModel.BackgroundColor = RGB(154,245,154 )
oButtonModel.TextColor=RGB(255,255,255)

  • but for the life of me I cannot discover a way to alter the size, or the font, of the text written on the buttons.
    My goal is to produce some buttons with fairly large text. (Bold, italic etc )
    I’m sure it is relatively easy but I cannot find it.

Please could someone assist.

Real code examples would be very useful - thankyou

You need properties:

    FontHeight = 25
    FontWeight = 150
    FontSlant = 1

FontHeight: Size font

FontWeight: Bold

FontSlant: Italic

I used in real example:

def test_dialog():
    args = dict(
        Name = 'dialog',
        Title = 'Test',
        Width = 150,
        Height = 100,
    )
    dlg = app.create_dialog(args)

    args = dict(
        Type = 'Button',
        Name = 'cmd_close',
        Label = 'Cerrar',
        Width = 100,
        Height = 30,
        FontHeight = 25,
        FontWeight = 150,
        FontSlant = 1,
    )
    dlg.add_control(args)
    dlg.open()
    return

That’s what I coudn’t find! - Thank you so much. I feel as if I’m getting somewhere now.
Much appreciated.

Please, mark like correct with ✓

So thanks to Mauricio I added these lines to the ones in the question:-

oButtonModel.FontWeight = 150 '#### BOLD (100=normal, 150-Bold), 200 = Black -chunky

oButtonModel.FontHeight = 16 ’ #### FONT SIZE

oButtonModel.FontName = “Comic Sans MS” '###### FONT used

and everything looked much better!