Re: [gtk-list] Re: Problem in viewport new behaviour



On Tue, 16 Mar 1999, Roberto wrote:

> Owen Taylor wrote:
> 
> > > In 1.0, I used a viewport to contain a preview of the font (it contained
> > > a gtk_pixmap). If the pixmap did not fit in the viewport, it just
> > > displayed a part of it. Which was exactly what I wanted.
> > > But in 1.2, the viewport resizes itself to display the whole pixmap,
> > > which makes my main window resize for each font. And the window cannot
> > > be resized smaller.
> > >
> > > Can I get the old behaviour somehow? I do not want to use scrollbars.
> > 
> >   gtk_widget_set_usize (widget, xsize_i_want, ysize_i_want);
> For each element clicked in a clist, a font preview is shown. Using this
> method,
> I would have (each time) to set the size of the viewport to the original
> size of the window, which is clumsy and, worse, would prevent the user
> from resizing it smaller.
> 
> > 
> > Since GtkLabel does clip its contents, there is probably
> > no reason to use a Viewport at all.
> But GtkLabel only displays text, and I am displaying a GtkPixmap.
> What else can I do? A DrawingArea, and then take care of expose events?
> Use an EventBox?
> 
> Quoting from the tutorial:
> "A viewport widget allows you to place a larger widget within it such
> that you can view a part of it at a time. It uses Adjustments to define
> the area that is currently in view"
> Is this no longer true in 1.2? How do you then get the behaviour?

hm, eventhough i suspect that using a scrolled window is what you really
should do, you can stop the subsequent size requests of the viewport by
setting gtk_container_set_resize_mode (viewport->parent, GTK_RESIZE_QUEUE);
this will prevent the newly requested size to propagate up to the toplevel.

> 
> 
> Thanks for the support,
> Roberto
> 

---
ciaoTJ



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