HowTo: Develop with GTKSharp

From OpenPetra Wiki
Jump to navigation Jump to search

API reference

data grid

toolbar

dialog

  • check for Gtk.ResponseType.Ok, because Cancel or None can happen when the dialog is just closed
    • in the login dialog case: check for ResponseType.Accect
  • default button: somehow DefaultResponse does not work as expected
    • use keypressevent; but careful: need GLib.ConnectBefore () to handle all key events [1]

label

  • alignment:
label.SetAlignment(0.5,0); // centered
label.SetAlignment(0,0); // left align
label.SetAlignment(1,0); // right align

table

align labels: see http://ubuntuforums.org/showthread.php?t=545949

table.Attach: can span across columns, and rows; use AttachOptions.Fill for align to work
for each label: SetAlignment, see above

custom controls