本文整理汇总了C++中GTK_ORIENTABLE函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_ORIENTABLE函数的具体用法?C++ GTK_ORIENTABLE怎么用?C++ GTK_ORIENTABLE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_ORIENTABLE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: photos_edit_palette_row_constructed
static void
photos_edit_palette_row_constructed (GObject *object)
{
PhotosEditPaletteRow *self = PHOTOS_EDIT_PALETTE_ROW (object);
GtkWidget *grid0;
GtkWidget *grid1;
GtkWidget *image;
GtkWidget *label;
GtkWidget *tool_widget;
const gchar *icon_name;
const gchar *name;
gchar *name_markup;
G_OBJECT_CLASS (photos_edit_palette_row_parent_class)->constructed (object);
self->row_revealer = gtk_revealer_new();
gtk_revealer_set_transition_type (GTK_REVEALER (self->row_revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
gtk_container_add (GTK_CONTAINER (self), self->row_revealer);
grid0 = gtk_grid_new ();
gtk_widget_set_margin_bottom (grid0, 6);
gtk_widget_set_margin_start (grid0, 18);
gtk_widget_set_margin_end (grid0, 18);
gtk_widget_set_margin_top (grid0, 6);
gtk_orientable_set_orientation (GTK_ORIENTABLE (grid0), GTK_ORIENTATION_VERTICAL);
gtk_container_add (GTK_CONTAINER (self->row_revealer), grid0);
grid1 = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (grid1), GTK_ORIENTATION_HORIZONTAL);
gtk_grid_set_column_spacing (GTK_GRID (grid1), 12);
gtk_container_add (GTK_CONTAINER (grid0), grid1);
icon_name = photos_tool_get_icon_name (self->tool);
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
gtk_container_add (GTK_CONTAINER (grid1), image);
name = photos_tool_get_name (self->tool);
label = gtk_label_new (NULL);
name_markup = g_strdup_printf ("<b>%s</b>", name);
gtk_label_set_markup (GTK_LABEL (label), name_markup);
gtk_container_add (GTK_CONTAINER (grid1), label);
self->details_revealer = gtk_revealer_new ();
gtk_revealer_set_transition_type (GTK_REVEALER (self->details_revealer),
GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
gtk_container_add (GTK_CONTAINER (grid0), self->details_revealer);
tool_widget = photos_tool_get_widget (self->tool);
gtk_widget_set_margin_bottom (tool_widget, 12);
gtk_widget_set_margin_top (tool_widget, 12);
gtk_container_add (GTK_CONTAINER (self->details_revealer), tool_widget);
gtk_size_group_add_widget (self->size_group, tool_widget);
g_signal_connect_swapped (self->tool, "hide-requested", G_CALLBACK (photos_edit_palette_row_hide_details), self);
gtk_widget_show_all (GTK_WIDGET (self));
g_free (name_markup);
g_clear_object (&self->size_group); /* We will not need it any more */
}
示例2: gtkProgressBarMapMethod
static int gtkProgressBarMapMethod(Ihandle* ih)
{
ih->handle = gtk_progress_bar_new();
if (!ih->handle)
return IUP_ERROR;
/* add to the parent, all GTK controls must call this. */
iupgtkAddToParent(ih);
gtk_widget_realize(ih->handle);
if (iupStrEqualNoCase(iupAttribGetStr(ih, "ORIENTATION"), "VERTICAL"))
{
#if GTK_CHECK_VERSION(3, 0, 0)
gtk_orientable_set_orientation(GTK_ORIENTABLE(ih->handle), GTK_ORIENTATION_VERTICAL);
gtk_progress_bar_set_inverted(GTK_PROGRESS_BAR(ih->handle), TRUE);
#else
gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(ih->handle), GTK_PROGRESS_BOTTOM_TO_TOP);
#endif
if (ih->userheight < ih->userwidth)
{
int tmp = ih->userheight;
ih->userheight = ih->userwidth;
ih->userwidth = tmp;
}
}
else
{
#if GTK_CHECK_VERSION(3, 0, 0)
gtk_orientable_set_orientation(GTK_ORIENTABLE(ih->handle), GTK_ORIENTATION_HORIZONTAL);
#else
gtk_progress_bar_set_orientation((GtkProgressBar*)ih->handle, GTK_PROGRESS_LEFT_TO_RIGHT);
#endif
}
if (iupAttribGetBoolean(ih, "MARQUEE"))
{
#if GTK_CHECK_VERSION(3, 0, 0)
gtk_progress_bar_pulse(GTK_PROGRESS_BAR(ih->handle));
#else
gtk_progress_set_activity_mode((GtkProgress*)ih->handle, TRUE);
#endif
ih->data->marquee = 1;
ih->data->timer = IupTimer();
IupSetCallback(ih->data->timer, "ACTION_CB", (Icallback)gtkProgressBarTimeCb);
IupSetAttribute(ih->data->timer, "TIME", "100");
iupAttribSet(ih->data->timer, "_IUP_PROGRESSBAR", (char*)ih);
gtk_progress_bar_set_pulse_step((GtkProgressBar*)ih->handle, 0.02);
}
else
ih->data->marquee = 0;
return IUP_NOERROR;
}
示例3: orientation_member
static int orientation_member(lua_State *L)
{
lua_box box;
luaA_to(L,lua_box,&box,1);
dt_lua_orientation_t orientation;
if(lua_gettop(L) > 2) {
luaA_to(L,dt_lua_orientation_t,&orientation,3);
gtk_orientable_set_orientation(GTK_ORIENTABLE(box->widget),orientation);
return 0;
}
orientation = gtk_orientable_get_orientation(GTK_ORIENTABLE(box->widget));
luaA_push(L,dt_lua_orientation_t,&orientation);
return 1;
}
示例4: gtk_scale_button_set_orientation_private
static void
gtk_scale_button_set_orientation_private (GtkScaleButton *button,
GtkOrientation orientation)
{
GtkScaleButtonPrivate *priv = button->priv;
if (orientation != priv->orientation)
{
priv->orientation = orientation;
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box),
orientation);
gtk_container_child_set (GTK_CONTAINER (priv->box),
button->plus_button,
"pack-type",
orientation == GTK_ORIENTATION_VERTICAL ?
GTK_PACK_START : GTK_PACK_END,
NULL);
gtk_container_child_set (GTK_CONTAINER (priv->box),
button->minus_button,
"pack-type",
orientation == GTK_ORIENTATION_VERTICAL ?
GTK_PACK_END : GTK_PACK_START,
NULL);
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->scale),
orientation);
if (orientation == GTK_ORIENTATION_VERTICAL)
{
gtk_widget_set_size_request (GTK_WIDGET (priv->scale),
-1, SCALE_SIZE);
gtk_range_set_inverted (GTK_RANGE (priv->scale), TRUE);
}
else
{
gtk_widget_set_size_request (GTK_WIDGET (priv->scale),
SCALE_SIZE, -1);
gtk_range_set_inverted (GTK_RANGE (priv->scale), FALSE);
}
/* FIXME: without this, the popup window appears as a square
* after changing the orientation
*/
gtk_window_resize (GTK_WINDOW (priv->dock), 1, 1);
g_object_notify (G_OBJECT (button), "orientation");
}
}
示例5: test_iconview_object_new
/* test that g_object_new keeps the provided area */
static void
test_iconview_object_new (void)
{
GtkWidget *view;
GtkCellArea *area;
area = gtk_cell_area_box_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (area), GTK_ORIENTATION_HORIZONTAL);
view = g_object_new (GTK_TYPE_ICON_VIEW, "cell-area", area, NULL);
g_assert (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (view)) == area);
g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (area)) == gtk_icon_view_get_item_orientation (GTK_ICON_VIEW (view)));
g_object_ref_sink (view);
g_object_unref (view);
}
示例6: objects_index_init
static void
objects_index_init (ObjectsIndex *index, G_GNUC_UNUSED ObjectsIndexClass *klass)
{
index->priv = g_new0 (ObjectsIndexPrivate, 1);
gtk_orientable_set_orientation (GTK_ORIENTABLE (index), GTK_ORIENTATION_VERTICAL);
}
示例7: ide_omni_search_display_init
static void
ide_omni_search_display_init (IdeOmniSearchDisplay *self)
{
self->providers = g_ptr_array_new_with_free_func (provider_entry_destroy);
gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL);
}
示例8: create_stat_win
void create_stat_win()
{
gwin_stat = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_has_resize_grip(GTK_WINDOW(gwin_stat), FALSE);
#if WIN32
set_no_focus(gwin_stat);
#endif
gtk_container_set_border_width (GTK_CONTAINER (gwin_stat), 0);
gtk_widget_realize (gwin_stat);
#if UNIX
GdkWindow *gdkwin0 = gtk_widget_get_window(gwin_stat);
set_no_focus(gwin_stat);
#else
win32_init_win(gwin_stat);
#endif
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox), GTK_ORIENTATION_VERTICAL);
gtk_container_add (GTK_CONTAINER (gwin_stat), vbox);
label_disp = gtk_label_new(NULL);
gtk_box_pack_start (GTK_BOX (vbox), label_disp, TRUE, TRUE, 0);
gtk_widget_show_all(gwin_stat);
timeout_handle = g_timeout_add(3000, timeout_update_stat, NULL);
}
示例9: box_init
static void box_init(lua_State* L)
{
lua_box box;
luaA_to(L,lua_box,&box,-1);
gtk_orientable_set_orientation(GTK_ORIENTABLE(box->widget),GTK_ORIENTATION_VERTICAL);
gtk_box_set_spacing(GTK_BOX(box->widget), DT_PIXEL_APPLY_DPI(5));
}
示例10: table_preferences_init
static void
table_preferences_init (TablePreferences *tpreferences, G_GNUC_UNUSED TablePreferencesClass *klass)
{
tpreferences->priv = g_new0 (TablePreferencesPrivate, 1);
gtk_orientable_set_orientation (GTK_ORIENTABLE (tpreferences), GTK_ORIENTATION_VERTICAL);
}
示例11: gucharmap_charmap_get_orientation
/**
* gucharmap_charmap_get_orientation:
* @charmap:
*
* Deprecated: 2.25.0
*/
GtkOrientation
gucharmap_charmap_get_orientation (GucharmapCharmap *charmap)
{
g_return_val_if_fail (GUCHARMAP_IS_CHARMAP (charmap), GTK_ORIENTATION_HORIZONTAL);
return gtk_orientable_get_orientation (GTK_ORIENTABLE (charmap));
}
示例12: gdict_speller_init
static void
gdict_speller_init (GdictSpeller *speller)
{
GdictSpellerPrivate *priv;
speller->priv = priv = gdict_speller_get_instance_private (speller);
gtk_orientable_set_orientation (GTK_ORIENTABLE (speller), GTK_ORIENTATION_VERTICAL);
priv->database = NULL;
priv->strategy = NULL;
priv->word = NULL;
priv->results = -1;
priv->context = NULL;
priv->store = gtk_list_store_new (MATCH_N_COLUMNS,
G_TYPE_INT, /* MatchType */
G_TYPE_STRING, /* db_name */
G_TYPE_STRING /* word */);
priv->start_id = 0;
priv->end_id = 0;
priv->match_id = 0;
priv->error_id = 0;
}
示例13: fcitx_ui_widget_init
static void
fcitx_ui_widget_init(FcitxUIWidget* self)
{
gtk_orientable_set_orientation(GTK_ORIENTABLE(self), GTK_ORIENTATION_VERTICAL);
self->label = gtk_label_new(_("Cannot load currently used user interface info"));
gtk_box_pack_start(GTK_BOX(self), self->label, TRUE, TRUE, 0);
}
示例14: file_modify_box_new
GtkWidget *
file_modify_box_new ()
{
GtkWidget *widget = GTK_WIDGET (g_object_new (file_modify_box_get_type (), NULL));
gtk_orientable_set_orientation (GTK_ORIENTABLE (widget), GTK_ORIENTATION_HORIZONTAL);
return widget;
}
示例15: orient_toggled
static void
orient_toggled (GtkToggleButton *button, gpointer user_data)
{
GList *orientables = (GList *) user_data, *ptr;
gboolean state = gtk_toggle_button_get_active (button);
GtkOrientation orientation;
if (state)
{
orientation = GTK_ORIENTATION_VERTICAL;
gtk_button_set_label (GTK_BUTTON (button), "Vertical");
}
else
{
orientation = GTK_ORIENTATION_HORIZONTAL;
gtk_button_set_label (GTK_BUTTON (button), "Horizontal");
}
for (ptr = orientables; ptr; ptr = ptr->next)
{
GtkOrientable *orientable = GTK_ORIENTABLE (ptr->data);
gtk_orientable_set_orientation (orientable, orientation);
}
}