[giraffe-user] Label/TextView in giraffe library

Kyle DENG captaindeng12138 at gmail.com
Tue Mar 5 05:51:02 CST 2024


Hello,

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.


Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://giraffelibrary.org/pipermail/giraffe-user_giraffelibrary.org/attachments/20240305/45b53f96/attachment-0001.html>


More information about the giraffe-user mailing list