Advertisement
palmerstone

Gtk Zoom label

Nov 25th, 2011
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. #include <time.h>
  2. #include <cairo.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <windows.h>
  6. #include <gtk/gtk.h>
  7. #include <gdk/gdk.h>
  8. #include <gtk/gtklabel.h>
  9. #include <gtk/gtkscale.h>
  10. #include <gtk/gtkhscale.h>
  11. #include <gtk/gtkvscale.h>
  12. #include <gdk/gdkkeysyms.h>
  13. #include <gdk-pixbuf/gdk-pixbuf.h>
  14.  
  15. int width, height;
  16. GtkWindow *window;
  17. GtkWidget *scale, *frame, *label;
  18. GtkButton *button;
  19.  
  20. int main(int argc, char *argv[])
  21. {
  22. gtk_init(&argc, &argv);
  23. width = gdk_screen_width();
  24. height = gdk_screen_height();
  25.  
  26. window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  27. gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, FALSE);
  28. gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_NONE);
  29. gtk_widget_set_size_request(GTK_WIDGET(window), width, height);
  30. gtk_window_set_title(GTK_WINDOW(window), "Nanana");
  31. frame = gtk_fixed_new();
  32. label = gtk_label_new("Zoom");
  33. button = gtk_button_new();
  34. gtk_widget_set_size_request(GTK_WIDGET(button), 30, 30);
  35. gtk_button_set_image (GTK_BUTTON(button),gtk_image_new_from_stock(GTK_STOCK_ZOOM_100, GTK_ICON_SIZE_BUTTON));
  36. gtk_fixed_put(GTK_FIXED(frame), GTK_WIDGET(label), 500, 370);
  37. gtk_fixed_put(GTK_FIXED(frame), GTK_WIDGET(button), 500, 330);
  38. gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(frame));
  39.  
  40. g_signal_connect(G_OBJECT(window), "delete-event",G_CALLBACK(gtk_main_quit), NULL);
  41. gtk_widget_show_all(GTK_WIDGET(window));
  42. gtk_widget_hide(label);
  43. gtk_main();
  44.  
  45. return 0x0;
  46. }
  47.  
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement