本文整理汇总了C++中GTK_IS_CONTAINER函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_IS_CONTAINER函数的具体用法?C++ GTK_IS_CONTAINER怎么用?C++ GTK_IS_CONTAINER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_IS_CONTAINER函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: gtk_pizza_adjust_allocations_recurse
static void
gtk_pizza_adjust_allocations_recurse (GtkWidget *widget,
gpointer cb_data)
{
GtkPizzaAdjData *data = cb_data;
widget->allocation.x += data->dx;
widget->allocation.y += data->dy;
if (GTK_WIDGET_NO_WINDOW (widget) && GTK_IS_CONTAINER (widget))
{
gtk_container_forall (GTK_CONTAINER (widget),
gtk_pizza_adjust_allocations_recurse,
cb_data);
}
}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:16,代码来源:win_gtk.c
示例2: scroll_adjust
static void scroll_adjust(GtkWidget* widget, void* data)
{
const AdjustData* p = static_cast<AdjustData*>(data);
widget->allocation.x += p->dx;
widget->allocation.y += p->dy;
if (widget->window == p->window)
{
// GtkFrame requires a queue_resize, otherwise parts of
// the frame newly exposed by the scroll are not drawn.
// To be safe, do it for all widgets.
gtk_widget_queue_resize_no_redraw(widget);
if (GTK_IS_CONTAINER(widget))
gtk_container_forall(GTK_CONTAINER(widget), scroll_adjust, data);
}
}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:16,代码来源:win_gtk.cpp
示例3: assign_tooltips_from_actions
static void assign_tooltips_from_actions(GtkWidget* widget)
{
if(G_LIKELY(GTK_IS_MENU_ITEM(widget)))
{
if(GTK_IS_ACTIVATABLE(widget))
assign_tooltip_from_action(widget);
widget = gtk_menu_item_get_submenu((GtkMenuItem*)widget);
if(widget)
assign_tooltips_from_actions(widget);
}
else if (GTK_IS_CONTAINER(widget))
{
gtk_container_forall((GtkContainer*)widget,
(GtkCallback)assign_tooltips_from_actions, NULL);
}
}
开发者ID:lxde,项目名称:libfm,代码行数:16,代码来源:fm-gtk-utils.c
示例4: do_align_left_widgets
static void
do_align_left_widgets (GtkWidget *first_level_child, GtkSizeGroup *size_group)
{
if (GTK_IS_HBOX (first_level_child)
|| GTK_IS_HBUTTON_BOX (first_level_child)) {
GtkSizeGroup *size_group_copy = size_group;
gtk_container_foreach (GTK_CONTAINER (first_level_child),
(GtkCallback) do_align_left_widget,
&size_group_copy);
}
else if (GTK_IS_CONTAINER (first_level_child)) {
gtk_container_foreach (GTK_CONTAINER (first_level_child),
(GtkCallback) do_align_left_widgets, size_group);
}
}
开发者ID:ejona86,项目名称:quarry,代码行数:16,代码来源:gtk-utils.c
示例5: eel_gtk_container_child_expose_event
/**
* eel_gtk_container_child_expose_event:
*
* @container: A GtkContainer widget.
* @child: A child of @container or NULL;
* @event: The expose event.
*
* Forward an expose event to a child if needed. It is valid to give a NULL @child.
* In that case this function is a noop. Proper clipping is done to ensure that the @child
* does indeed need to be forwarded the exposure event. Finally, the forwarding
* only occurs if the child is a NO_WINDOW widget. Of course, it is valid to feed
* non NO_WINDOW widgets to this function, in which case this function is a noop.
*/
void
eel_gtk_container_child_expose_event (GtkContainer *container,
GtkWidget *child,
GdkEventExpose *event)
{
g_return_if_fail (GTK_IS_CONTAINER (container));
if (child == NULL)
{
return;
}
g_return_if_fail (GTK_IS_WIDGET (child));
gtk_container_propagate_expose (container, child, event);
}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:29,代码来源:eel-gtk-container.c
示例6: get_n_labels_from_button
static gint
get_n_labels_from_button (GtkWidget *button)
{
GtkWidget *child;
gint n_labels;
n_labels = 0;
child = gtk_bin_get_child (GTK_BIN (button));
if (GTK_IS_ALIGNMENT (child))
child = gtk_bin_get_child (GTK_BIN (child));
if (GTK_IS_CONTAINER (child))
count_labels (GTK_CONTAINER (child), &n_labels);
return n_labels;
}
开发者ID:BYC,项目名称:gtk,代码行数:17,代码来源:gailbutton.c
示例7: wrappedChild
/* void willAppendChild (in nsIDOMNode child); */
NS_IMETHODIMP
xgGtkElement::WillAppendChild (nsIDOMNode *child)
{
if (!GTK_IS_CONTAINER (mObject)) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<xgIGObjectHolder> wrappedChild (do_QueryInterface (child));
GObject *widget = NULL;
if (!wrappedChild || NS_FAILED (wrappedChild->GetGObject (&widget)) ||
!GTK_IS_WIDGET (widget)) {
return NS_ERROR_FAILURE;
}
gtk_container_add (GTK_CONTAINER (mObject), GTK_WIDGET (widget));
return NS_OK;
}
开发者ID:jberkman,项目名称:gom,代码行数:18,代码来源:xgGtkElement.cpp
示例8: find_mnemonic_widget
static GtkWidget *
find_mnemonic_widget (GtkWidget *widget,
gint level)
{
gboolean can_focus;
g_object_get (widget, "can-focus", &can_focus, NULL);
if (GTK_WIDGET_GET_CLASS (widget)->activate_signal ||
can_focus ||
GTK_WIDGET_GET_CLASS (widget)->mnemonic_activate !=
GTK_WIDGET_CLASS (g_type_class_peek (GTK_TYPE_WIDGET))->mnemonic_activate)
{
return widget;
}
if (GIMP_IS_SIZE_ENTRY (widget))
{
GimpSizeEntry *entry = GIMP_SIZE_ENTRY (widget);
return gimp_size_entry_get_help_widget (entry,
entry->number_of_fields - 1);
}
else if (GTK_IS_CONTAINER (widget))
{
GtkWidget *mnemonic_widget = NULL;
GList *children;
GList *list;
children = gtk_container_get_children (GTK_CONTAINER (widget));
for (list = children; list; list = g_list_next (list))
{
mnemonic_widget = find_mnemonic_widget (list->data, level + 1);
if (mnemonic_widget)
break;
}
g_list_free (children);
return mnemonic_widget;
}
return NULL;
}
开发者ID:ni1son,项目名称:gimp,代码行数:46,代码来源:gimpwidgetsutils.c
示例9: EvalCcRqMENUENABLE
void EvalCcRqMENUENABLE (CrossCallInfo *pcci) /* parent, zero based position of menu, onoff; no result. */
{
GtkWidget *parent_menu, *sub_menu;
printf("EvalCcRqMENUENABLE\n");
gint index = pcci->p2;
if (pcci->p1 && GTK_IS_CONTAINER(pcci->p1))
{
printf("We have a container. Checking the widget.\n");
parent_menu = GTK_WIDGET(pcci->p1);
gtk_container_foreach(GTK_CONTAINER(parent_menu), pcci->p3 ?
enable_menu_callback : disable_menu_callback,
(gpointer) (&index));
}
MakeReturn0Cci (pcci);
}
开发者ID:camilstaps,项目名称:ObjectIO,代码行数:17,代码来源:cCrossCallMenus_121.c
示例10: change_font
// If you should ever need to change the font for the running application..
// Ugly but effective.
void
change_font(GtkWidget *widget, gpointer data)
{
PangoFontDescription *font_desc;
gchar *font = (gchar*)data;
const gchar *name;
font_desc = pango_font_description_from_string(font);
if (font_desc == NULL) exit(1);
gtk_widget_modify_font(widget, font_desc);
name = ghb_get_setting_key(widget);
g_debug("changing font for widget %s\n", name);
if (GTK_IS_CONTAINER(widget))
{
gtk_container_foreach((GtkContainer*)widget, change_font, data);
}
}
开发者ID:TotalCaesar659,项目名称:HandBrake,代码行数:19,代码来源:main.c
示例11: useEvent
static bool
useEvent(GtkWidget *widget, GdkEventButton *event)
{
if(lastRejectedEvent && lastRejectedEvent==event)
return false;
if(!GTK_IS_CONTAINER(widget))
return true;
// if widget is a notebook, accept if there is no hovered tab
if (GTK_IS_NOTEBOOK(widget)) {
return (!Tab::hasVisibleArrows(GTK_NOTEBOOK(widget)) &&
Tab::currentHoveredIndex(widget) == -1 &&
childrenUseEvent(widget, event, false));
} else {
return childrenUseEvent(widget, event, false);
}
}
开发者ID:KDE,项目名称:qtcurve,代码行数:18,代码来源:wmmove.cpp
示例12: get_label_from_button
static GtkWidget *
get_label_from_button (GtkWidget *button)
{
GtkWidget *child;
child = gtk_bin_get_child (GTK_BIN (button));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (GTK_IS_ALIGNMENT (child))
child = gtk_bin_get_child (GTK_BIN (child));
G_GNUC_END_IGNORE_DEPRECATIONS
if (GTK_IS_CONTAINER (child))
child = find_label_child (GTK_CONTAINER (child));
else if (!GTK_IS_LABEL (child))
child = NULL;
return child;
}
开发者ID:3v1n0,项目名称:gtk,代码行数:18,代码来源:gtkbuttonaccessible.c
示例13: SetStyleRecursively
/*
* SetStyleRecursively
*
* Set the widget's style to the style (data) and make sure
* that all the children (if it's a container) are also set
* to that particular style.
*/
void SetStyleRecursively (GtkWidget *widget, gpointer data)
{
GtkStyle *style;
/* --- Get the style --- */
style = (GtkStyle *) data;
/* --- Set the style of the widget --- */
gtk_widget_set_style (widget, style);
/* --- If it may have children widgets --- */
if (GTK_IS_CONTAINER (widget)) {
/* --- Set all the children's styles too. --- */
gtk_container_foreach (GTK_CONTAINER (widget),
SetStyleRecursively, style);
}
}
开发者ID:EVODelavega,项目名称:gtk-examples,代码行数:25,代码来源:button.c
示例14: gb_label_get_focus_targets
static void
gb_label_get_focus_targets (GtkWidget * widget,
GList ** focus_targets)
{
if (GTK_WIDGET_CAN_FOCUS (widget) && GB_IS_GB_WIDGET (widget))
{
*focus_targets = g_list_insert_sorted (*focus_targets,
(gchar*) gtk_widget_get_name (widget),
g_str_equal);
}
if (GTK_IS_CONTAINER (widget))
{
gtk_container_forall (GTK_CONTAINER (widget),
(GtkCallback) gb_label_get_focus_targets,
focus_targets);
}
}
开发者ID:cooljeanius,项目名称:glade-1.1.3,代码行数:18,代码来源:gblabel.c
示例15: on_toggle_border_widths
static void
on_toggle_border_widths (GtkToggleButton *button,
void *data)
{
gboolean has_border;
int i;
has_border = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
for (i = 0; i < TEST_WIDGET_LAST; ++i)
{
if (GTK_IS_CONTAINER (test_widgets[i]))
{
gtk_container_set_border_width (GTK_CONTAINER (test_widgets[i]),
has_border ? 50 : 0);
}
}
}
开发者ID:RavikumarTulugu,项目名称:antkorp,代码行数:18,代码来源:testadjustsize.c
示例16: eel_gtk_container_child_unmap
/**
* eel_gtk_container_child_unmap:
*
* @container: A GtkContainer widget.
* @child: A child of @container or NULL;
*
* Unmap a child if needed. This is usually called from the "GtkWidget::unmap"
* method of the @container widget. If @child is NULL, then this function is a noop.
*/
void
eel_gtk_container_child_unmap (GtkContainer *container,
GtkWidget *child)
{
g_return_if_fail (GTK_IS_CONTAINER (container));
if (child == NULL)
{
return;
}
g_return_if_fail (gtk_widget_get_parent (child) == GTK_WIDGET (container));
if (gtk_widget_get_visible (child) && gtk_widget_get_mapped (child))
{
gtk_widget_unmap (child);
}
}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:27,代码来源:eel-gtk-container.c
示例17: set_creation_container
void set_creation_container (hf_options_struct *hfo, GtkWidget *creation_container) {
gboolean already_set=FALSE;
if (hfo->creation_container)
already_set = TRUE;
if (!(creation_container && hfo))
return;
// printf("HFO->CREATION_CONTAINER in SET_CREATION_CONTAINER: %d->%d\n",hfo,creation_container);
if (GTK_WIDGET(creation_container))
if (GTK_IS_CONTAINER(creation_container))
hfo->creation_container = creation_container;
else
printf("SET_CREATION_CONTAINER: %d is not a container\n", creation_container);
else
printf("SET_CREATION_CONTAINER: %d is not a widget\n", creation_container);
if (!already_set)
gtk_box_pack_start(GTK_BOX(creation_container), hfo->fd_struct->filter_dialog, FALSE, FALSE, 0);
// gtk_container_add(GTK_CONTAINER(creation_container), hfo->fd_struct->filter_dialog);
}
开发者ID:consultit,项目名称:geomorph,代码行数:18,代码来源:hf_dialog_options.c
示例18: test_list_descendants
static GList*
test_list_descendants (GtkWidget *widget,
GType widget_type)
{
GList *results = NULL;
if (GTK_IS_CONTAINER (widget))
{
GList *node, *list = gtk_container_get_children (GTK_CONTAINER (widget));
for (node = list; node; node = node->next)
{
if (!widget_type || g_type_is_a (G_OBJECT_TYPE (node->data), widget_type))
results = g_list_prepend (results, node->data);
else
results = g_list_concat (results, test_list_descendants (node->data, widget_type));
}
g_list_free (list);
}
return results;
}
开发者ID:jdapena,项目名称:gtk,代码行数:19,代码来源:gtktestutils.c
示例19: eel_gtk_container_child_remove
/**
* eel_gtk_container_child_remove:
*
* @container: A GtkContainer widget.
* @child: A non NULL child of @container.
*
* Remove @child from @container. The @container is resized if needed.
* This is usually called from the "GtkContainer::remove" method of the
* @container. The child cannot be NULL.
*/
void
eel_gtk_container_child_remove (GtkContainer *container,
GtkWidget *child)
{
gboolean child_was_visible;
g_return_if_fail (GTK_IS_CONTAINER (container));
g_return_if_fail (GTK_IS_WIDGET (child));
g_return_if_fail (gtk_widget_get_parent (child) == GTK_WIDGET (container));
child_was_visible = gtk_widget_get_visible (child);
gtk_widget_unparent (child);
if (child_was_visible)
{
gtk_widget_queue_resize (GTK_WIDGET (container));
}
}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:29,代码来源:eel-gtk-container.c
示例20: brasero_file_chooser_find_pane
static void
brasero_file_chooser_find_pane (GtkWidget *child,
gpointer footer)
{
if (GTK_IS_PANED (child)) {
GList *children_vbox;
GList *iter_vbox;
GtkWidget *vbox;
vbox = gtk_paned_get_child2 (GTK_PANED (child));
children_vbox = gtk_container_get_children (GTK_CONTAINER (vbox));
for (iter_vbox = children_vbox; iter_vbox; iter_vbox = iter_vbox->next) {
if (GTK_IS_BOX (iter_vbox->data) &&
gtk_orientable_get_orientation (GTK_ORIENTABLE (iter_vbox->data)) == GTK_ORIENTATION_HORIZONTAL) {
GtkPackType packing;
gtk_box_query_child_packing (GTK_BOX (vbox),
GTK_WIDGET (iter_vbox->data),
NULL,
NULL,
NULL,
&packing);
if (packing == GTK_PACK_START) {
GtkRequisition total_request, footer_request;
gtk_widget_get_preferred_size (GTK_WIDGET (vbox),
&total_request, NULL);
gtk_widget_get_preferred_size (GTK_WIDGET (iter_vbox->data),
&footer_request, NULL);
*((gint *) footer) = total_request.height - footer_request.height;
break;
}
}
}
g_list_free (children_vbox);
}
else if (GTK_IS_CONTAINER (child)) {
gtk_container_foreach (GTK_CONTAINER (child),
brasero_file_chooser_find_pane,
footer);
}
}
开发者ID:Arkoprovo1996,项目名称:brasero,代码行数:43,代码来源:brasero-file-chooser.c
注:本文中的GTK_IS_CONTAINER函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论