How can i set htmlDialog size in percentage instead of pixels

How can i set htmlDialog size in percentage instead of pixels

Percentage of what?
Do you think about relative to Viewport :
Viewl#vpheight-instance_method

model = Sketchup.active_model
view = model.active_view
vp_height = view.vpheight

dlg_height = vp_height*50/100
dlg_width = dlg_height*80/100
dialog = UI::HtmlDialog.new(
{
  :dialog_title => "Dialog Example",
  :preferences_key => "com.sample.plugin",
  :scrollable => true,
  :resizable => true,
  :width => dlg_width,
  :height => dlg_height,
  :left => 100,
  :top => 100,
  :min_width => 50,
  :min_height => 50,
  :max_width =>1000,
  :max_height => 1000,
  :style => UI::HtmlDialog::STYLE_DIALOG
})
dialog.set_url("http://www.sketchup.com")
dialog.show


dialog.set_size(dlg_width*75/100, vp_height*60/100)
1 Like

yeah relative to viewport but why are you multiplying vp_height to 50 and dlg_height t0 80 and dividing with 100 and in the last line also??

80% : 80/100 = 0.8 = 0.80 whatever you wish it was an example and the last line also!!