Re: Maximum window width



Goran Rakic wrote:
I know how to implement minimum width, but how to implement maximum width. If I turn off resize function, than both width and height will be locked to prefered values. But, I want only width to be fixed as I have some pixmap in window "header" and window mustn't be wider than that pixmap.

Hmmm,
    This isnt an absolute answer (maybe there is an api somewhere that
I'm missing ? anyone ?) but here is a hint to somthing that probably
works.

- handle the "configure-event" for the widget in question.

- you'll have a GdkEventConfigure structure:
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Event-Structures.html#GdkEventConfigure

- check the width/height or whatever you want to be "capped" at a
maximum value.

- if you dont want this "configure" to take place return TRUE (which
  signifies that the event was "handled")

- otherwise return FALSE (and emmission will continue resulting in the
  correct handler getting called and your widget getting resized).

I know; it aint pretty. but its all I can think of without doing your
research for you ;-)

Regards,
                       -Tristan






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