static void Main() { Iup.Open(); IupControls.Open(); IupGL.Open(); IupHandle button, bkbox; using (IupHandle dlg = Iup.Dialog( Iup.Vbox( LabelText("Namn:"), LabelText("Adress:"), LabelText("Gata:"), button = Iup.Button("OK") ).SetAttributes("ALIGNMENT=ARIGHT,NGAP=4") ) ) { //openitem.SetCallback ("K_cO", new CallbackKeyPressCB (OnKeyPress)); byte[] img = new byte[100 * 100 * 3]; img[10] = 25; IupHandle iupimg = Iup.ImageRGB(100, 100, img); var ep = Iup.ElementPropertiesDialog(button); ep.Show(); dlg.Show(); Iup.MainLoop(); } Iup.Close(); }
static void Main() { Iup.Open(); Dialog dlg = new Dialog("My dialog") { Expand = Expand.Yes }; Glyph gl = Glyph.FromFile("c:\\temp\\egg24.bmp"); VBox vbox = new VBox(dlg) { Align = HAlign.Center, Margin = new Size(18, 8), Gap = 4 }; Button escbtn = new Button(vbox, "esc") { BackColor = Color.Red, Expand = Expand.Yes, Alignment = Alignment.BottomRight }; Button enterbtn = new Button(vbox, "enter") { Expand = Expand.No }; new Button(vbox, "gamma") { BackColor = Color.Red, Expand = Expand.Yes, Alignment = Alignment.BottomRight, Flat = true }; Button btn = new Button(vbox, "delta") { Expand = Expand.No, Flat = true, Glyph = gl }; Text txt = new Text(vbox); btn.CBClick += delegate { Point p = dlg.ScreenPosition; Point p2 = btn.ScreenPosition; int debug = 0; }; dlg.MenuBox = true; dlg.Shrink = false; // dlg.CBDropFiles += dlg_CBDropFiles; dlg.Tray = true; dlg.TrayTip = "Hello world"; dlg.TrayGlyph = gl; dlg.CBMove += dlg_CBMove; dlg.CBClose += dlg_CBClose; dlg.CBResize += dlg_CBResize; dlg.StartFocus = btn; dlg.CBTrayClick += dlg_CBTrayClick; dlg.Show(); Iup.MainLoop(); dlg.Dispose(); dlg = null; GC.Collect(); }