Commits

Sébastien Ferré committed 6a78a65

Improved object description dialog windows (scrollable, selectable, non-modal)

  • Participants
  • Parent commits 6ce565d

Comments (0)

Files changed (1)

   Tarpit.effect (fun obs ->
     let descr = history#store#description ~obs name in
     let markup = make_markup (Lisql.Display.of_s1 ~obs history#store descr) in
-    let md = GWindow.message_dialog
-	~message:markup
-	~use_markup:true
-	~message_type:`INFO
+    let w = GWindow.dialog
+	~destroy_with_parent:true
+	~modal:false
+	~deletable:true
 	~title:"Object description"
-	~buttons:GWindow.Buttons.ok
-	~modal:true () in
-    md#run ();
-    md#destroy ())
+	~width:300 ~height:600 ~allow_shrink:true
+	() in
+    let vbox = w#vbox in
+    let sw = GBin.scrolled_window
+	~shadow_type:`NONE
+	~placement:`TOP_LEFT
+	~hpolicy:`AUTOMATIC
+	~vpolicy:`AUTOMATIC
+	~packing:(vbox#pack ~expand:true ~fill:true)
+	() in
+    let label = GMisc.label ~markup ~selectable:true ~xalign:0. ~yalign:0. ~packing:sw#add_with_viewport () in
+    let action_area = w#action_area in
+    let button_ok = GButton.button ~stock:`CLOSE ~packing:action_area#add () in
+    button_ok#connect#clicked ~callback:w#destroy;
+    w#show ())
+
 
 let ctx_menu_clicked lx ctx_menu =
 print_endline "menu_clicked";