RE: FW: Making a custom widget scrollable



You need to create Gtk::Adjustment widgets and set them on a Gtk::ScrolledWindow to make the scroll bars to work.

Widgets that have native scroll support are for examples, Gtk::TreeView, Gtk::TextView and Gtk::Layout.

For other widgets that lack native scrolling, such as a Gtk::VBox or in your case, a Drawing Area, you probably want to add this widget to a Gtk::Viewport. Then add the viewport to your area of interest.

Raul Davis


Hi, I'm having some difficulty getting my custom drawn widget (using a derived Gtk::DrawingArea) to be scrollable.

The DrawingArea itself only draws a plain grid (the size varies based on the amount of rows and columns requested), and sometimes that grid obviously becomes too big to display at once, so scrolling functionality is necessary. However, I'm not sure as to how I would implement scrolling. I already tried added the widget to a ScrolledWindow, but apparently that didn't work.

Any ideas? Thanks in advance.


_________________________________________________________________
Take charge with a pop-up guard built on patented Microsoft® SmartScreen Technology http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*.




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