GtkEntry ... change size
- From: Mariano Gaudix <marianocordobario3 gmail com>
- To: gtk devel <gtk-app-devel-list gnome org>
- Subject: GtkEntry ... change size
- Date: Sun, 27 Oct 2013 10:45:50 -0200
Hello
I can not change the size to GtkEntry . I am using Gtk 3.6 .
I need a GtkEntry small , for my graphic interface .
GtkWidget *entry = gtk_entry_new ();
gtk_widget_set_size_request( entry , 20 , -1);
///////////////////////////////////////////////code
///////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include <string.h> /* for css */
int main( int argc,
char *argv[] )
{
gtk_init (&argc, &argv);
GtkWidget *window;
GtkWidget *vbox, *hbox;
GtkWidget *toolbar;
GtkWidget *button ,*boton ;
GtkWidget *grid;
gchar *nodo;
char *str ;
GdkColor color;
GdkColor color2;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_size_request (GTK_WIDGET (window), 300, 100);
gtk_window_set_title (GTK_WINDOW (window), "GTK Entry");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect_swapped (window, "delete-event",
G_CALLBACK (gtk_widget_destroy),
window);
/*-------------------------------------------------------------------------------------------------*/
toolbar = gtk_toolbar_new();
gtk_container_add (GTK_CONTAINER (window), toolbar);
gtk_widget_set_size_request( toolbar, 50 , 60);
gtk_toolbar_set_icon_size (GTK_TOOLBAR(toolbar),
GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_toolbar_set_show_arrow (GTK_TOOLBAR(toolbar) ,TRUE );
/*-----------------------------------------------------------------------------------------------------*/
GtkToolItem *ka ;
ka = gtk_tool_item_new () ;
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), ka , -1);
/*-----------------------------------------------------------------------------------------------------*/
grid =gtk_grid_new () ;
gtk_container_add (GTK_CONTAINER (ka), grid);
/*-----------------------------------------------------------------------------------------------------*/
GtkWidget *entry = gtk_entry_new ();
gtk_grid_attach (GTK_GRID (grid), entry, 0, 0, 1, 1);
gtk_widget_set_size_request( entry , 20 , -1);
/****************************************************************************/
boton =gtk_toggle_button_new_with_label (" nodo" );
gtk_grid_attach (GTK_GRID (grid), boton, 1, 0, 1, 1) ;
/************************************************************************************/
gtk_widget_show_all (window);
gtk_main();
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]