How to implement Label/TextVIew with giraffe library in SML

28 Views Asked by At

I hope to create a Label/TextView here and can setText or getText at any time. But I can't find the relevant interface documentation and can query how to implement it. val textEntry = Entry.new () val () = Grid.attach grid (textEntry, 0, 0, 5, 1)

fun activate app () =
  let
    open Gtk

    (* create a new window, and set its title *)
    val window = ApplicationWindow.new app
    val () = Window.setTitle window "Window"
    val () = Container.setBorderWidth window 10

    (* Here we construct the container that is going pack our buttons *)
    val grid = Grid.new ()

    (* Pack the container in the window *)
    val () = Container.add window grid

    (* val textEntry = Label.new (SOME "Input: ") *)
    val textEntry = Entry.new ()
    val () = Grid.attach grid (textEntry, 0, 0, 5, 1)

    val () = Widget.showAll window
  in
    ()
  end

I want to know how to create a Label/TextView and be able to setText or getText at any time.

0

There are 0 best solutions below