Results 1 to 9 of 9

Thread: PyGTK question (Hide VBox Overflow)

  1. #1
    Join Date
    Oct 2007
    Location
    Minneapolis, MN, USA
    Beans
    461

    PyGTK question (Hide VBox Overflow)

    If I have a VBox how do I make it so that if its children try to exceed it's boundaries instead of forcing it's children to shrink it just cuts off anything going out of its boundaries (something similar to CSS's overflow:hidden; )?

    (See attachment for visual example of what I'm trying to achieve.)
    Attached Images Attached Images
    "What does fighting crime mean, exactly? Does it mean upholding the law when a woman shoplifts to feed her children, or does it mean struggling to uncover the ones who, quite legally, have brought about her poverty?"
    Adrian Veidt, Watchmen

  2. #2
    Join Date
    Oct 2007
    Location
    Minneapolis, MN, USA
    Beans
    461

    Re: PyGTK question (Hide VBox Overflow)

    Bump
    "What does fighting crime mean, exactly? Does it mean upholding the law when a woman shoplifts to feed her children, or does it mean struggling to uncover the ones who, quite legally, have brought about her poverty?"
    Adrian Veidt, Watchmen

  3. #3
    Join Date
    Apr 2006
    Location
    Hamilton, New Zealand
    Beans
    198
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: PyGTK question (Hide VBox Overflow)

    I don't think what you want to do is possible with Gtk, However the way I would do it is to wrap the VBox in a ScrolledWindow.

    That should do something similar to what you want.

  4. #4
    Join Date
    Oct 2007
    Location
    Minneapolis, MN, USA
    Beans
    461

    Re: PyGTK question (Hide VBox Overflow)

    But I don't want scrollbars or even the ability to scroll to be present. Although if there really is no other way I guess I will have to resort to that.
    "What does fighting crime mean, exactly? Does it mean upholding the law when a woman shoplifts to feed her children, or does it mean struggling to uncover the ones who, quite legally, have brought about her poverty?"
    Adrian Veidt, Watchmen

  5. #5
    Join Date
    Apr 2006
    Location
    Hamilton, New Zealand
    Beans
    198
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: PyGTK question (Hide VBox Overflow)

    If you don't want that then I'd suggest that you keep track of the number of children in the vbox if there are more than X you set any the visibility of any new children to be false. When you remove a child you'll have to go through the children and choose one to have it's visibility turned on.

  6. #6
    Join Date
    Oct 2007
    Location
    Minneapolis, MN, USA
    Beans
    461

    Re: PyGTK question (Hide VBox Overflow)

    When I try adding a scrolled window around the vbox I get an error saying vbox is not a scrollable widget, and to use a viewport with the scrolled window. When I surround my vbox with a viewport and the viewport with the scrolled window I cannot see the vbox when I start my app.
    "What does fighting crime mean, exactly? Does it mean upholding the law when a woman shoplifts to feed her children, or does it mean struggling to uncover the ones who, quite legally, have brought about her poverty?"
    Adrian Veidt, Watchmen

  7. #7
    Join Date
    Oct 2007
    Location
    Minneapolis, MN, USA
    Beans
    461

    Re: PyGTK question (Hide VBox Overflow)

    Bump.
    "What does fighting crime mean, exactly? Does it mean upholding the law when a woman shoplifts to feed her children, or does it mean struggling to uncover the ones who, quite legally, have brought about her poverty?"
    Adrian Veidt, Watchmen

  8. #8
    Join Date
    Nov 2008
    Location
    Athens, Hellas
    Beans
    332
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: PyGTK question (Hide VBox Overflow)

    Quote Originally Posted by sekinto View Post
    If I have a VBox how do I make it so that if its children try to exceed it's boundaries instead of forcing it's children to shrink it just cuts off anything going out of its boundaries (something similar to CSS's overflow:hidden; )?

    (See attachment for visual example of what I'm trying to achieve.)
    Without having any knowledge about PyGTK ( I am using WxPython) I would assume that this would required some "hacking" probably you would like to make your own classes that override the exist one and change the behaviour.

    Probably override the functions responsible for the shrink and replace them with your own. This way you will be able to change the behavior without changing the libraries and messing with PyGTK or GTK+. One of the big advantages of OOP.

    you should be looking for tutorials to customise the PyGTK and GTK+ by class inheritance.

    something along these lines

    http://www.pygtk.org/articles/writin...sing-pygtk.htm

  9. #9
    Join Date
    May 2007
    Beans
    4,513
    Distro
    Ubuntu

    Re: PyGTK question (Hide VBox Overflow)

    Just hide the widgets you'd like not to be shown.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •