"Responsive Design" with Gtk+



Hi All,

In my reddit application, I have this terribly long buttonbox that displays some useful information about each comment (eg. showing the author's name, score, date, etc).  However, the box gets too long for the window sometimes.  In that situation, it is desirable for me to hide some of the buttons (eg, don't show the date) rather than force the user to expand the window.

Is there an idiomatic way to do this?

My current hack scares me.  It is quite simple [1]. I wrap the button box in a GtkBin, which uses Height for Width size allocation.  When the box is asked for it's minimum requires width, it reports 1px,  When it is asked for it's preferred hight for width, it takes that width figure and hides the appropriate buttons to fit within that width.  However, this causes a lot of gtk warnings in the console.  It is also very slow.

Thanks,
Sam

[1] https://github.com/samdroid-apps/something-for-reddit/blob/master/src/comments.py#L413-L438


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