gtk - How do I add ScrolledWindow support to a custom Widget in GtkMM? -
Writing a custom widget for GTKM which is to display a huge dataset (think something like 4096x256 characters datasheet).
Due to the reasons for most beauty, but also for possible use in a Glade / GTK-builder editor, I want this widget to support the scrolled windows as originally supported, After it is set as a child of the scrolled window, it is identified as a scroll widget, which allows horizontal and vertical adjusting objects to be set, which Can manipulate it in the.
To do this, it seems to me that the creator of something like this is my widget:
// Get GTK type type from the wrapper class GtkWidget * gwidget = This- & gt; Gobj (); // fantasy code here that magically creates a gobject signal, // we can catch in c ++ // it is actually the part of which i do not know how to do that. Count my_signal = magic_way_to_create_this_signal (& MyClass :: rainbow_unicorn_signal_handler); // Scroll recognizes this window as scrollable GTK_WIDGET_GET_CLASS (gwidget) - & gt; Set_scroll_it_error_ignal = my_signal;
Later, the signal emitted by the scrolled window when the widget is added, does my widget need to be caught by a signal proxy method or something? I do not know.
How can I do this?
' magic_to_create_this_signal_only
' You can find it in your widget's my_widget_class_init ( )
call the function, which is part of the GOBZ method of defining a class. I'm not sure exactly what's in GTKM.
Also see in GTK Docs, where it is explained why there is such a problem with scrolling down a widget.
You can also insert your widget into it that adds scrolling capabilities to its child widget.