hello forum,
i’ve got a question concerning Gtk::Window auto-resizing behavior.
i’m working on an audio player, and i’ve got two different versions -
one that is just a basic player, and another that looks like a turntable
(i should be able to share it soon, should anyone give a hoot…) in
the basic player, i set up the gui inside a #Window like this:
##################
…(truncated)
btnBox = Gtk::HBox.new(true,2)
…
btnBox.pack_start(player.playBtn,false,false,0)
…
box = Gtk::VBox.new(false, 0)
box.pack_start(player.infoBox, false, false, 2)
box.pack_start(player.progBox, false, false, 2)
box.pack_start(player.artBox, true, true, 2)
box.pack_start(btnBox, false, false, 2)
player.mainWin.add(box)
player.mainWin.show_all
####################
this has the nice effect that the #Window starts up sized to fit
everything, and automatically resizes according to the size of the
infoBox (an #EventBox with a #Label in it)… that is to say, if the
text within the label is longer than the #Window allows for, the #Window
gets bigger vertically to accomodate it. this was through no plan of my
own (i must admit,) but i really like the effect.
the other player is basically the same, but instead of packing the
buttons and the artBox (an EventBox with an album-cover #Image inside
it,) i pack the infoBox and the “table” (an instance of a class which
inherits from Gtk::Layout) into a #VBox, like this:
####################
box = Gtk::VBox.new(false, 0)
box.pack_start(player.infoBox, false, false, 2)
box.pack_start(player.table, true, true, 2)
player.mainWin.add(box)
player.mainWin.show_all
####################
strange thing is that although this seems exactly the same to me, it
has a very different behavior. here, the mainWin #Window is quite small
at startup, and after manually resizing the mainWin, it no longer
resizes to accomodate for different text lengths - the infoBox now
pushes the table #Layout down and cuts it off at the bottom of the
mainWin, rather than pushing the mainWin up and expanding it, as in the
first example.
got me stumped… any ideas what’s going on here?
thanks in advance for any help -
-jk