本文整理汇总了C++中GTK_IS_CONTAINER函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_IS_CONTAINER函数的具体用法?C++ GTK_IS_CONTAINER怎么用?C++ GTK_IS_CONTAINER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_IS_CONTAINER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}