Re: Windows sizing problem



Il dom, 2002-07-28 alle 04:01, James Henstridge ha scritto:
> Marco Pesenti Gritti wrote:
> 
> >I spent a lot of time trying to implement javascript popup sizing code
> >in galeon but I never got it working correctly. I could use some help by
> >someone more clued then me here :)
> >
> >What I'd need is:
> >
> >1 The window should be sized so that the embedded mozilla widget has a
> >given width/height
> >2 It should still be possible for the user to shrink the window
> >3 The embedded mozilla widget can change his size also after the window
> >has been showed, and window size should be updated.
> >
> >Things that I already tried:
> >- Using gtk_widget_set_size_request on the mozilla widget make 2 not
> >work at all, and 3 fail when new width/height is smaller.
> >- Using gtk_window_resize seem to fit the requirements. But I couldnt
> >find a reliable way to calculate window size for the given mozilla
> >widget width/height.
> >
> >I tried every kind of hacks to work around the problem but I didnt get
> >anything acceptable. Any help would be appreciated.
> >I hope there is a simple solution :)
> >  
> >
> It is probably a bit of a hack, but you could try running 
> gtk_widget_get_size_request() on both the GtkMozEmbed and toplevel 
> GtkWindow.  The difference in height/width will give you an idea of the 
> size of the chrome round the content area, which you could use to guess 
> what sizes to pass to gtk_window_resize().
> 

get_size_request returns -1, -1. 
Docs say it should return the size that was explicitly set using
set_size_request ... so it's not what I need ? or am I missing something
here ?

I tried gtk_widget_size_request, it sort of work but there are still
some problems.
- The window height is 4 pixels bigger when showed (seem something due
to the statusbar but I'm really not sure what.
- It's impossible to calculate the window width because the toolbar has
it's own width requisition. So I need to assume it's 0 ... This breaks
if the toolbar orientation is vertical or if you have a sidebar showed.

This thing is getting me crazy ... :)

Thanks for your help.

Marco





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]