shoes / shoes3

a tiny graphical app kit for ruby
http://walkabout.mvmanila.com
Other
181 stars 19 forks source link

Styles for Window and Dialog are the same #29

Open IanTrudel opened 9 years ago

IanTrudel commented 9 years ago

Window and Dialog are essentially the same styles. It would be expected that a dialog box is similar to an alert but with more control on its contents, for which minimize and maximize buttons are hidden and with the possibility to be modal or not. Shoes Manual clearly states that dialog should be given a dialog box look.

dialog(styles) { ... } » Shoes::App

Opens a new app window (just like the window method does,) but the
window is given a dialog box look.

SAMPLE CODE

Shoes.app(:title => "Window and Dialog") {
   window(:title => "Window", :width => 250, :height => 100) {
      para "Some text\n"
      button("ok")
   }
   dialog(:title => "Dialog", :width => 250, :height => 100) {
      para "Some text\n"
      button("ok")
   }
}
ccoupe commented 9 years ago

I think the manual has been wrong for many years. We should fix the manual. Supporting modal dialog boxes would add a lot of code and they're pretty unfriendly for new comers since Shoes Windows don't easily share the parents variables.

IanTrudel commented 9 years ago

Window and Dialog are supposed to be different and GTK does support dialog boxes. Modal could be reissued as an enhancement with low priority though calling gtk_window_set_modal() when modal is true would do the trick.

references http://zetcode.com/tutorials/gtktutorial/gtkdialogs/ https://developer.gnome.org/gtk3/stable/GtkDialog.html

passenger94 commented 9 years ago

i think there is a beginning (very short) to this in canvas.c and natives methods : window_plain / dialog_plain on ruby side, shoes_native_window_color / shoes_native_dialog_color on c side looks like something was planed in that direction