本文整理汇总了C++中GTK_ALIGNMENT函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_ALIGNMENT函数的具体用法?C++ GTK_ALIGNMENT怎么用?C++ GTK_ALIGNMENT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_ALIGNMENT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: create_content_metadata_wnd
// object hierarchy:
// parent
// |-- background (event-box)
// |-- alignment
// |-- vbox
// |-- name item
// |-- desc item
// |-- finish item
//
GtkWidget* create_content_metadata_wnd(GtkWidget * parent)
{
CL_LOGPRINTF("entry");
// main window
g_wnd.window = parent;
// g_signal_connect(G_OBJECT(g_wnd.window), "focus-in-event", G_CALLBACK(on_main_wnd_focus_in), wnd);
// g_signal_connect(G_OBJECT(g_wnd.window), "key_press_event", G_CALLBACK(on_keypress), wnd);
g_signal_connect(G_OBJECT(g_wnd.window), "expose-event", G_CALLBACK(on_expose), NULL);
// background
GtkWidget* background = gtk_event_box_new();
gtk_widget_set_name(GTK_WIDGET(background), "content_wnd_background");
gtk_widget_set_size_request(GTK_WIDGET(background), METADATA_BK_IMG_WIDTH, METADATA_BK_IMG_HEIGHT);
gtk_container_add(GTK_CONTAINER(parent), background);
gtk_widget_show(background);
// alignment
GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 0.0, 0.0);
gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), METADATA_VBORDER, METADATA_VBORDER, METADATA_HBORDER, METADATA_HBORDER);
gtk_container_add(GTK_CONTAINER(background), alignment);
gtk_widget_show(alignment);
// vbox
GtkWidget* vbox = gtk_vbox_new(FALSE, METADATA_WND_ITEM_SPACING);
gtk_container_add(GTK_CONTAINER(alignment), vbox);
gtk_widget_show(vbox);
// name item
createNameItem(vbox);
// desc item
createDescItem(vbox);
// finish item
createFinishItem(vbox);
// set screen texts
content_metadata_set_text();
// instance-private data
g_wnd.on_change_occurred = FALSE;
g_wnd.on_movecursor_occurred = FALSE;
g_wnd.display_update_pending = FALSE;
return background;
}
开发者ID:vastin,项目名称:iliad-hacking,代码行数:56,代码来源:gtkMetadataWnd.c
示例2: gtk_settingitem_new
// widget hierarchy
// |--settingitem (GtkSettingItem)
// |--background (GtkEventBox)
// |--alignment
// |--vbox
// |--label_show_time_prompt
// |--label_current_time
GtkWidget *create_current_time_display(void)
{
GtkWidget* settingitem;
GtkWidget* background;
GtkWidget* alignment;
GtkWidget* vbox;
GtkWidget* label;
// settingitem
settingitem = gtk_settingitem_new("");
gtk_widget_set_size_request(settingitem, -1, -1);
// background
background = gtk_event_box_new();
gtk_widget_set_name(background, "datetime_display_background");
gtk_widget_set_size_request(background, TITLE_MIN_WIDTH, DATETIME_DISPLAY_HEIGHT);
gtk_settingitem_add_details(GTK_SETTINGITEM(settingitem), background);
// alignment
alignment = gtk_alignment_new(0, 0, 0, 0);
gtk_alignment_set_padding(GTK_ALIGNMENT(alignment),
DATETIME_SCREEN_ITEM_PADDING_TOP,
DATETIME_SCREEN_ITEM_PADDING_BOTTOM,
DATETIME_SCREEN_ITEM_PADDING_LEFT,
DATETIME_SCREEN_ITEM_PADDING_RIGHT);
gtk_container_add(GTK_CONTAINER(background), alignment);
// vbox
vbox = gtk_vbox_new(FALSE, DATETIME_DISPLAY_SPACING);
gtk_container_add(GTK_CONTAINER(alignment), vbox);
label = gtk_label_new("");
gtk_widget_set_name(label, "datetime_screen_info_text");
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
g_datetime_screen->label_show_time_prompt = label;
label = gtk_label_new("");
gtk_widget_set_name(label, "datetime_screen_date_text");
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
g_datetime_screen->label_current_time = label;
gtk_widget_show_all(background);
gtk_widget_show(settingitem);
return settingitem;
}
开发者ID:vastin,项目名称:iliad-hacking,代码行数:54,代码来源:iLiadDateTimeScreen.c
示例3: end_clicked_cb
static void
end_clicked_cb (GtkButton *button, JanaGtkRecurrence *self)
{
GtkWidget *window, *datetime, *check, *toplevel, *vbox, *close, *align;
JanaGtkRecurrencePrivate *priv = RECURRENCE_PRIVATE (self);
JanaTime *time;
/* Time-editing dialog */
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button));
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
if (GTK_WIDGET_TOPLEVEL (toplevel))
gtk_window_set_transient_for (GTK_WINDOW (window),
GTK_WINDOW (toplevel));
gtk_window_set_modal (GTK_WINDOW (window), TRUE);
gtk_window_set_type_hint (GTK_WINDOW (window),
GDK_WINDOW_TYPE_HINT_DIALOG);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
check = gtk_check_button_new_with_mnemonic ("Repeats _forever");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
priv->recur->end ? FALSE : TRUE);
time = priv->recur->end ?
jana_time_duplicate (priv->recur->end) :
jana_time_duplicate (priv->time);
jana_time_set_isdate (time, TRUE);
datetime = jana_gtk_date_time_new (time);
jana_gtk_date_time_set_editable (JANA_GTK_DATE_TIME (datetime), TRUE);
gtk_widget_set_sensitive (datetime, priv->recur->end ? TRUE : FALSE);
align = gtk_alignment_new (1.0, 0.5, 0.0, 1.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (align), 6, 0, 0, 0);
close = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
gtk_container_add (GTK_CONTAINER (align), close);
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), datetime, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
g_object_set_data (G_OBJECT (window), "self", self);
g_signal_connect (check, "toggled",
G_CALLBACK (forever_toggled_cb), datetime);
g_signal_connect (close, "clicked",
G_CALLBACK (close_clicked_cb), datetime);
gtk_widget_show_all (window);
}
开发者ID:dudochkin-victor,项目名称:jana,代码行数:47,代码来源:jana-gtk-recurrence.c
示例4: ol_osd_toolbar_init
static void
ol_osd_toolbar_init (OlOsdToolbar *toolbar)
{
OlOsdToolbarPriv *priv = OL_OSD_TOOLBAR_GET_PRIVATE (toolbar);
gtk_alignment_set (GTK_ALIGNMENT (toolbar), 0.5, 0.5, 0.0, 0.0);
toolbar->center_box = GTK_HBOX (gtk_hbox_new (FALSE, 0));
gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (toolbar->center_box));
toolbar->prev_button = _add_button (toolbar, &btn_spec[BTN_PREV]);
toolbar->play_button = _add_button (toolbar, &btn_spec[BTN_PLAY]);
toolbar->pause_button = _add_button (toolbar, &btn_spec[BTN_PAUSE]);
toolbar->stop_button = _add_button (toolbar, &btn_spec[BTN_STOP]);
toolbar->next_button = _add_button (toolbar, &btn_spec[BTN_NEXT]);
priv->player = NULL;
_update_status (toolbar);
_update_caps (toolbar);
}
开发者ID:lenoch,项目名称:osdlyrics,代码行数:18,代码来源:ol_osd_toolbar.c
示例5: create_expander
static GtkWidget*
create_expander (const char *caption,
GtkWidget *child,
gdouble xscale,
gdouble yscale)
{
GtkWidget *expander = gtk_expander_new ("");
GtkWidget *label = gtk_expander_get_label_widget (GTK_EXPANDER (expander));
GtkWidget *align = gtk_alignment_new (0, 0, xscale, yscale);
gtk_alignment_set_padding (GTK_ALIGNMENT (align), 6, 0, 18, 0);
gtk_label_set_markup (GTK_LABEL (label), caption);
gtk_container_add (GTK_CONTAINER (expander), align);
gtk_container_add (GTK_CONTAINER (align), child);
return expander;
}
开发者ID:qezt,项目名称:liblunar,代码行数:18,代码来源:test-calendar.c
示例6: create_simple_modal_dialog_window
GtkWindow* create_simple_modal_dialog_window(const char* title, ModalDialog& dialog, GtkWidget* contents)
{
GtkWindow* window = create_fixedsize_modal_dialog_window(0, title, dialog);
GtkVBox* vbox1 = create_dialog_vbox(8, 4);
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(vbox1));
gtk_container_add(GTK_CONTAINER(vbox1), contents);
GtkAlignment* alignment = GTK_ALIGNMENT(gtk_alignment_new(0.5, 0.0, 0.0, 0.0));
gtk_widget_show(GTK_WIDGET(alignment));
gtk_box_pack_start(GTK_BOX(vbox1), GTK_WIDGET(alignment), FALSE, FALSE, 0);
GtkButton* button = create_dialog_button("OK", G_CALLBACK(dialog_button_ok), &dialog);
gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(button));
return window;
}
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:18,代码来源:dialog.cpp
示例7: app_window_common
static GtkWidget *create_small_app_window(void)
{
GtkWidget *window, *parent, *widget;
GtkTooltips *tt;
window = app_window_common();
/* event box to catch clicks on the tokencode frame */
widget = gtk_event_box_new();
g_signal_connect(widget, "button-press-event",
G_CALLBACK(clipboard_callback), NULL);
gtk_container_add(GTK_CONTAINER(window), widget);
parent = widget;
/* tooltip */
tt = gtk_tooltips_new();
gtk_tooltips_set_tip(tt, parent, "Click to copy to clipboard", NULL);
/* tokencode frame */
widget = gtk_frame_new("Tokencode");
gtk_container_add(GTK_CONTAINER(parent), widget);
parent = widget;
/* spacing inside the frame */
widget = gtk_alignment_new(0.5, 0.5, 1.0, 1.0);
gtk_alignment_set_padding(GTK_ALIGNMENT(widget), 10, 10, 10, 10);
gtk_container_add(GTK_CONTAINER(parent), widget);
parent = widget;
/* vbox */
widget = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(parent), widget);
parent = widget;
/* tokencode */
gtk_box_pack_start(GTK_BOX(parent), tokencode_text, FALSE, FALSE, 0);
/* progress bar */
progress_bar = gtk_progress_bar_new();
gtk_widget_set_size_request(progress_bar, 0, 10);
gtk_box_pack_start(GTK_BOX(parent), progress_bar, FALSE, FALSE, 0);
return window;
}
开发者ID:MufriA,项目名称:stoken,代码行数:44,代码来源:gui.c
示例8: create_frame
static GtkWidget*
create_frame (const char *caption,
GtkWidget *child,
gdouble xscale,
gdouble yscale)
{
GtkWidget *frame = gtk_frame_new ("");
GtkWidget *label = gtk_frame_get_label_widget (GTK_FRAME (frame));
GtkWidget *align = gtk_alignment_new (0, 0, xscale, yscale);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
gtk_alignment_set_padding (GTK_ALIGNMENT (align), 6, 0, 18, 0);
gtk_label_set_markup (GTK_LABEL (label), caption);
gtk_container_add (GTK_CONTAINER (frame), align);
gtk_container_add (GTK_CONTAINER (align), child);
return frame;
}
开发者ID:qezt,项目名称:liblunar,代码行数:19,代码来源:test-calendar.c
示例9: gtk_event_box_new
// widget layout
// parent
// |-alignment
// |--vbox
// |--sortTypeWidget
// |--sortOrderWidget
// |--sortFinishWidget
//
GtkWidget *create_sort_wnd(GtkWidget * parent)
{
GtkWidget *background;
GtkWidget *alignment;
GtkWidget *vbox;
GtkWidget *sortTypeWidget;
GtkWidget *sortOrderWidget;
GtkWidget *sortFinishWidget;
// background
background = gtk_event_box_new();
gtk_widget_set_name(GTK_WIDGET(background), "sort_wnd_background");
gtk_widget_set_size_request(GTK_WIDGET(background), (-1), (-1));
gtk_container_add(GTK_CONTAINER(parent), background);
// alignment
alignment = gtk_alignment_new(0.0, 0.0, 0.0, 0.0);
gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 0, 0);
gtk_container_add(GTK_CONTAINER(background), alignment);
// vbox
vbox = gtk_vbox_new(FALSE, SORT_WND_SPACING_V);
gtk_container_add(GTK_CONTAINER(alignment), vbox);
// sortTypeWidget
sortTypeWidget = create_sort_type_widget();
gtk_box_pack_start(GTK_BOX(vbox), sortTypeWidget, FALSE, FALSE, 0);
// sortOrderWidget
sortOrderWidget = create_sort_order_widget();
gtk_box_pack_start(GTK_BOX(vbox), sortOrderWidget, FALSE, FALSE, 0);
// sortFinishWidget
sortFinishWidget = create_sort_finish_widget();
gtk_box_pack_start(GTK_BOX(vbox), sortFinishWidget, FALSE, FALSE, 0);
// global variables
g_sort_wnd.window = parent;
// show widgets
gtk_widget_show_all(background);
// signal
g_signal_connect(G_OBJECT(g_sort_wnd.window), "expose-event", G_CALLBACK(on_sort_wnd_expose), NULL);
// return
return background;
}
开发者ID:vastin,项目名称:iliad-hacking,代码行数:51,代码来源:gtkSortWnd.c
示例10: sprintf
void diaElemFrame::setMe(void *dialog, void *opaque,uint32_t line)
{
GtkWidget *label;
GtkWidget *table;
GtkWidget *alignment;
GtkWidget *vbox;
char str[200];
sprintf(str,"<b>%s</b>",paramTitle);
label = gtk_label_new (str);
gtk_misc_set_alignment (GTK_MISC (label), 0, 1);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_widget_show(label);
vbox = gtk_vbox_new (0, 0);
alignment = gtk_alignment_new (0.5, 0.5, 1, 1);
gtk_widget_show (alignment);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 18, 0);
table = gtk_table_new (frameSize, 2, FALSE);
gtk_container_add (GTK_CONTAINER (alignment), table);
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_box_pack_start (GTK_BOX(vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX(vbox), alignment, FALSE, FALSE, 0);
gtk_widget_show(table);
gtk_widget_show(vbox);
gtk_box_pack_start (GTK_BOX(opaque), vbox, FALSE, FALSE, 0);
uint32_t v=0;
for(int i=0;i<nbElems;i++)
{
elems[i]->setMe(dialog,table,v);
v+=elems[i]->getSize();
}
myWidget=(void *)table;
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:43,代码来源:FAC_frame.cpp
示例11: setup_plugin_pages
/***************Plugins pages****************/
static void
setup_plugin_pages (GtrPreferencesDialog * dlg)
{
GtkWidget *alignment;
GtkWidget *page_content;
alignment = gtk_alignment_new (0., 0., 1., 1.);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 12, 12, 12, 12);
page_content = peas_gtk_plugin_manager_new (NULL);
g_return_if_fail (page_content != NULL);
gtk_container_add (GTK_CONTAINER (alignment), page_content);
gtk_box_pack_start (GTK_BOX (dlg->priv->plugins_box),
alignment, TRUE, TRUE, 0);
gtk_widget_show_all (page_content);
}
开发者ID:psanxiao,项目名称:gtranslator,代码行数:20,代码来源:gtr-preferences-dialog.c
示例12: contacts_edit_add_focus_events
static GtkWidget *
contacts_edit_add_focus_events (GtkWidget *widget, GtkWidget *ebox,
GList *widgets)
{
if (!ebox) {
GtkWidget *align = gtk_alignment_new (0.5, 0.5, 1, 1);
ebox = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (align), widget);
gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, 6, 6);
gtk_container_add (GTK_CONTAINER (ebox), align);
gtk_widget_show (align);
gtk_widget_show (ebox);
gtk_widget_set_name (ebox, gtk_widget_get_name (widget));
}
if (!widget)
return ebox;
if (GTK_IS_CONTAINER (widget) && !GTK_IS_TEXT_VIEW (widget)) {
GList *c, *children =
gtk_container_get_children (GTK_CONTAINER (widget));
for (c = children; c; c = c->next) {
contacts_edit_add_focus_events (GTK_WIDGET (c->data),
ebox, widgets);
}
g_list_free (children);
} else if (GTK_IS_WIDGET (widget)) {
GList *w;
g_signal_connect (G_OBJECT (widget), "focus-in-event",
G_CALLBACK (contacts_edit_focus_in), ebox);
g_signal_connect (G_OBJECT (widget), "focus-out-event",
G_CALLBACK (contacts_edit_focus_out), ebox);
for (w = widgets; w; w = w->next) {
g_signal_connect (G_OBJECT (widget), "focus-in-event",
G_CALLBACK (contacts_edit_focus_in), w->data);
g_signal_connect (G_OBJECT (widget), "focus-out-event",
G_CALLBACK (contacts_edit_focus_out), w->data);
}
}
return ebox;
}
开发者ID:GNOME,项目名称:contacts,代码行数:42,代码来源:contacts-edit-pane.c
示例13: popup_new
GtkWidget* popup_new(GtkWidget* parent, const gchar* text, gboolean mouse)
{
GtkWidget* w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_type_hint(GTK_WINDOW(w), GDK_WINDOW_TYPE_HINT_UTILITY);
gtk_window_set_position(GTK_WINDOW(w), mouse ? GTK_WIN_POS_MOUSE : GTK_WIN_POS_CENTER_ALWAYS);
if (parent)
gtk_window_set_transient_for(GTK_WINDOW(w), GTK_WINDOW(gtk_widget_get_toplevel(parent)));
gtk_window_set_modal(GTK_WINDOW(w), TRUE);
gtk_window_set_decorated(GTK_WINDOW(w), TRUE);
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(w), TRUE);
if (text) {
GtkWidget* label = gtk_label_new(text);
GtkWidget* align = gtk_alignment_new(0, 0, 1, 1);
gtk_alignment_set_padding(GTK_ALIGNMENT(align), 20, 20, 20, 20);
gtk_container_add(GTK_CONTAINER(align), label);
gtk_container_add(GTK_CONTAINER(w), align);
}
return w;
}
开发者ID:areslp,项目名称:fcitx-configtool,代码行数:20,代码来源:keygrab.c
示例14: empathy_new_account_dialog_init
static void
empathy_new_account_dialog_init (EmpathyNewAccountDialog *self)
{
GtkWidget *w, *hbox, *content;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
EMPATHY_TYPE_NEW_ACCOUNT_DIALOG, EmpathyNewAccountDialogPrivate);
self->priv->main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (self->priv->main_vbox), 12);
gtk_widget_show (self->priv->main_vbox);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (self->priv->main_vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
w = gtk_label_new (_("What kind of chat account do you have?"));
gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0);
gtk_widget_show (w);
w = gtk_alignment_new (0, 0, 0, 0);
gtk_alignment_set_padding (GTK_ALIGNMENT (w), 0, 0, 12, 0);
gtk_box_pack_start (GTK_BOX (self->priv->main_vbox), w, FALSE, FALSE, 0);
gtk_widget_show (w);
self->priv->chooser = empathy_protocol_chooser_new ();
gtk_box_pack_start (GTK_BOX (hbox), self->priv->chooser, FALSE, FALSE, 0);
gtk_widget_show (self->priv->chooser);
content = gtk_dialog_get_content_area (GTK_DIALOG (self));
gtk_container_add (GTK_CONTAINER (content), self->priv->main_vbox);
g_signal_connect (self->priv->chooser, "changed",
G_CALLBACK (protocol_changed_cb), self);
/* trigger show the first account widget */
protocol_changed_cb (GTK_COMBO_BOX (self->priv->chooser), self);
gtk_window_set_title (GTK_WINDOW (self), _("Adding new account"));
}
开发者ID:DylanMcCall,项目名称:Empathy---Hide-contact-groups,代码行数:40,代码来源:empathy-new-account-dialog.c
示例15: pgd_movie_view_set_movie
void
pgd_movie_view_set_movie (GtkWidget *movie_view,
PopplerMovie *movie)
{
GtkWidget *alignment;
GtkWidget *table;
GtkWidget *button;
gint row = 0;
alignment = gtk_bin_get_child (GTK_BIN (movie_view));
if (alignment) {
gtk_container_remove (GTK_CONTAINER (movie_view), alignment);
}
alignment = gtk_alignment_new (0.5, 0.5, 1, 1);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 5, 5, 12, 5);
gtk_container_add (GTK_CONTAINER (movie_view), alignment);
gtk_widget_show (alignment);
if (!movie)
return;
table = gtk_grid_new ();
gtk_grid_set_column_spacing (GTK_GRID (table), 6);
gtk_grid_set_row_spacing (GTK_GRID (table), 6);
pgd_table_add_property (GTK_GRID (table), "<b>Filename:</b>", poppler_movie_get_filename (movie), &row);
pgd_table_add_property (GTK_GRID (table), "<b>Need Poster:</b>", poppler_movie_need_poster (movie) ? "Yes" : "No", &row);
pgd_table_add_property (GTK_GRID (table), "<b>Show Controls:</b>", poppler_movie_show_controls (movie) ? "Yes" : "No", &row);
button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PLAY);
g_signal_connect (button, "clicked",
G_CALLBACK (pgd_movie_view_play_movie),
movie);
pgd_table_add_property_with_custom_widget (GTK_GRID (table), NULL, button, &row);
gtk_widget_show (button);
gtk_container_add (GTK_CONTAINER (alignment), table);
gtk_widget_show (table);
}
开发者ID:Pitinets,项目名称:poppler,代码行数:40,代码来源:utils.c
示例16: add_grid_rows
static void
add_grid_rows (VpnPasswordDialog *dialog)
{
VpnPasswordDialogPrivate *priv = VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
int row;
int offset = 0;
gtk_alignment_set_padding (GTK_ALIGNMENT (priv->grid_alignment), 0, 0, offset, 0);
/* This will not kill the entries, since they are ref:ed */
gtk_container_foreach (GTK_CONTAINER (priv->grid), (GtkCallback) remove_child, priv->grid);
row = 0;
if (priv->show_password)
add_row (priv->grid, row++, priv->primary_password_label, priv->password_entry);
if (priv->show_password_secondary)
add_row (priv->grid, row++, priv->secondary_password_label, priv->password_entry_secondary);
gtk_grid_attach (GTK_GRID (priv->grid), priv->show_passwords_checkbox, 1, row, 1, 1);
gtk_widget_show_all (priv->grid);
}
开发者ID:RoboMod,项目名称:network-manager-ipop,代码行数:22,代码来源:vpn-password-dialog.c
示例17: utl_gui_create_frame
GtkWidget *
utl_gui_create_frame (GtkWidget *container, const gchar *name)
{
GtkWidget *frame, *label, *alignment;
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
/* gtk_container_add (GTK_CONTAINER (container), frame);*/
gtk_box_pack_start (GTK_BOX (container), frame, FALSE, FALSE, 0);
label = utl_gui_create_label ("<b>%s</b>", name);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_frame_set_label_widget (GTK_FRAME (frame), label);
alignment = gtk_alignment_new (0.5, 0.5, 1, 1);
gtk_container_add (GTK_CONTAINER (frame), alignment);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment),
ALIGNMENT_PADDING_TOP, ALIGNMENT_PADDING_BOTTOM,
ALIGNMENT_PADDING_LEFT, ALIGNMENT_PADDING_RIGHT);
return alignment;
}
开发者ID:rosedu,项目名称:osmo,代码行数:22,代码来源:utils_gui.c
示例18: GTK_DIALOG
static GtkWidget *create_pref_page(Plugin *p, GtkWidget *dialog)
{
GtkWidget *page = NULL; /* some plugins don't have prefs */
if (p->cbs.configure)
{
page = p->cbs.configure(&p->public, GTK_DIALOG(dialog), p->cb_data);
if (! GTK_IS_WIDGET(page))
{
geany_debug("Invalid widget returned from plugin_configure() in plugin \"%s\"!",
p->info.name);
return NULL;
}
else
{
GtkWidget *align = gtk_alignment_new(0.5, 0.5, 1, 1);
gtk_alignment_set_padding(GTK_ALIGNMENT(align), 6, 6, 6, 6);
gtk_container_add(GTK_CONTAINER(align), page);
page = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(page), align, TRUE, TRUE, 0);
}
}
开发者ID:dreamsxin,项目名称:geany,代码行数:23,代码来源:pluginutils.c
示例19: d_die
struct s_interface *f_interface_initialize(struct s_interface *supplied, const char *builder_path) {
struct s_interface *result = supplied;
int index;
if (!result)
if (!(result = (struct s_interface *)d_malloc(sizeof(struct s_interface))))
d_die(d_error_malloc);
result->destroy = d_false;
if ((result->interface = gtk_builder_new()))
if ((gtk_builder_add_from_file(result->interface, builder_path, NULL))) {
d_assert(result->window = GTK_WINDOW(gtk_builder_get_object(result->interface, "v_window")));
for (index = 0; index < e_interface_chart_NULL; ++index) {
d_assert(f_chart_new(&(result->logic_charts[index])));
d_assert(f_chart_hook_interface(&(result->logic_charts[index]), "../components/UI/UI_scale_config.glade"));
f_chart_style(&(result->logic_charts[index]), "styles/base_graph.keys");
f_chart_style(&(result->logic_charts[index]), v_interface_chart_styles[index]);
d_assert(result->charts[index] = GTK_ALIGNMENT(gtk_builder_get_object(result->interface, v_interface_charts[index])));
gtk_container_add(GTK_CONTAINER(result->charts[index]), g_object_ref(result->logic_charts[index].plane));
}
for (index = 0; index < e_interface_label_NULL; ++index)
d_assert(result->labels[index] = GTK_LABEL(gtk_builder_get_object(result->interface, v_interface_labels[index])));
}
return result;
}
开发者ID:nardinan,项目名称:magrathea,代码行数:23,代码来源:interface.c
示例20: mate_password_dialog_set_show_userpass_buttons
/**
* mate_password_dialog_set_show_userpass_buttons:
* @password_dialog: A #MatePasswordDialog
* @show_userpass_buttons: Boolean value that controls whether the radio buttons for connecting
* anonymously and connecting as user should be shown or not.
*
* Description: Shows the radio buttons for connecting anonymously and connecting as user if
* @show_userpass_buttons is #TRUE. Also makes the 'Username' and 'Password' fields greyed out if the
* radio button for connecting anonymously is active. If @show_userpass_buttons is #FALSE, then these
* radio buttons are hidden and the 'Username' and 'Password' fields will be made active.
*
* Since: 2.8
*/
void
mate_password_dialog_set_show_userpass_buttons (MatePasswordDialog *password_dialog,
gboolean show)
{
MatePasswordDialogDetails *priv;
const gchar *username;
gboolean sensitive = TRUE;
g_return_if_fail (MATE_IS_PASSWORD_DIALOG (password_dialog));
priv = password_dialog->details;
show = show != FALSE;
priv->show_userpass_buttons_set = TRUE;
if (priv->show_userpass_buttons != show) {
priv->show_userpass_buttons = show;
g_object_set (priv->radio_vbox, "visible", priv->show_userpass_buttons, NULL);
if (show) {
sensitive = !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->connect_with_no_userpass_button));
}
gtk_widget_set_sensitive (priv->table_alignment, sensitive);
gtk_alignment_set_padding (GTK_ALIGNMENT (priv->table_alignment),
0, 0, show ? 12 : 0, 0);
/* Compute default */
if (!priv->anonymous_set) {
username = gtk_entry_get_text (GTK_ENTRY (priv->username_entry));
mate_password_dialog_set_anon (password_dialog,
username == NULL || username[0] == '\0', FALSE);
}
g_object_notify (G_OBJECT (password_dialog), "readonly-domain");
}
}
开发者ID:fatman2021,项目名称:libmateui,代码行数:50,代码来源:mate-password-dialog.c
注:本文中的GTK_ALIGNMENT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论