--# Page Setup Unix dialog demo (don't use) include GtkEngine.e constant docs = `Page Setup Unix Dialog Click button to pop up a dialog box. This doesn't really print anything, just shows a simple printer select dialog and how to set and retrieve print settings. ` -- format for listing settings; constant fmt = ` Name: [] Display: [] PPD name: [] Paper width: [.2] Paper height: [.2] Page width: [.2] Page height: [.2] Left margin: [.2] Right margin: [.2] Top margin: [.2] Bot margin: [.2] Orientation: [] ` constant orientation = {"Portrait","Landscape","Reverse Portrait","Reverse Landscape"} constant win = create(GtkWindow,{ {"default size",300,200}, {"border width",10}, {"position",GTK_WIN_POS_CENTER}, {"connect","destroy","Quit"}}) constant panel = create(GtkBox,VERTICAL) add(win,panel) constant lbl = create(GtkLabel) set(lbl,"markup",docs) add(panel,lbl) constant box = pack_end(panel,create(GtkButtonBox)) add(box,{ create(GtkButton,"gtk-quit","Quit"), create(GtkButton,"gtk-ok#_Go","ShowPageSetup")}) show_all(win) main() ----------------------------- global function ShowPageSetup() ----------------------------- object dlg = create(GtkPageSetupUnixDialog) if get(dlg,"run") = MB_OK then object setup = get(dlg,"page setup") object papersize = get(setup,"paper size") set(lbl,"markup",format(fmt, {get(papersize,"name"), get(papersize,"display name"), get(papersize,"ppd name"), round(get(setup,"paper width",GTK_UNIT_INCH),10), round(get(setup,"paper height",GTK_UNIT_INCH),10), round(get(setup,"page width",GTK_UNIT_INCH),10), round(get(setup,"page height",GTK_UNIT_INCH),10), round(get(setup,"left margin",GTK_UNIT_INCH),10), round(get(setup,"right margin",GTK_UNIT_INCH),10), round(get(setup,"top margin",GTK_UNIT_INCH),10), round(get(setup,"bottom margin",GTK_UNIT_INCH),10), orientation[get(setup,"orientation")+1] })) end if set(dlg,"destroy") return 1 end function