Skip to content

lablgtk compatibility #10

@martindemello

Description

@martindemello

lablgtk has a very nice object layer on top of gtk; its main drawback is that it is handwritten. It would be nice if we could identify patterns in the lablgtk api that could be autogenerated, so that code could be ported to ocaml-gtk easily.

Some examples:

  • widget#get_foo becomes widget#foo throughout (e.g. Widget_.get_height -> widget#height)
  • widget#signal_connect_foo becomes widget#connect#foo (e.g. button#connect#clicked)
  • Method arguments are labelled; this is probably hard to do automatically in every case, but there are some common cases like every signal connector having a ~callback argument that could be added to the code generator.
  • Widget constructors have a ~packing argument that autogenerates the packing to add them to their parents (e.g. let btn = GButton.button ~label:"Get Targets" ~packing:window#add ()) which is extremely nice to use and eliminates a lot of boilerplate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions