Damien Krotkine > Gtk2Fu > Gtk2Fu

Download:
Gtk2Fu-0.11.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.11   Source  

NAME ^

Gtk2Fu - GTK2 Forked Ultimate, a powerful layer on top of Gtk2. (forked from ugtk2.)

VERSION ^

Version 0.11

INTRODUCTION ^

gtk2-fu is a layer on top of perl gtk2, that brings power, simplicity and speed of development. It brings additional methods to ease the widget creation among other things. But the most important feature is that it brings you a lot of derivated methods from existing methods, that does exactly the same thing, except that ir returns the widget. Example :

  $window->set_title('foo');  #the normal method
  $window->set_title_('foo');  #the gtk2-fu derivated method

set_title_ does the same things as set_title, but it returns $window.

What's the advantage? you can chain actions ! Look at the 2 code examples below :

  # normal perl-gtk2
  my $window = Gtk2::Window->new();
  my $entry = Gtk2::Entry->new();
  $entry->set_text('foo');
  $entry->set_editable(0);
  $window->add($entry);

  # using gtk2-fu
  my $window = Gtk2::Window->new();
  $window->add(
    Gtk2::Entry->new()
      ->set_text_('foo')
      ->set_editable_(0)
  );

You could even get rid of the $window declaration. The gain can seem to you very minor, but in more complex cases, it allows you to create a complex GUI really easilly. You'll find a bigger example at the end of this documentation

In addition to this feature, gtk2-fu provides a toolbox of useful help methods to create widgets, ask things to the user, and misc other things.

HISTORY ^

gtk2-fu is a fork of ugtk2 (Ultimate gtk2) which is a port to gtk2 of ugtk (Ultimate gtk), which is an improvment of mygtk, which was the created by pixel at mandrakesoft, to basically address the same issues.

ugtk2 is great, but mandrakesoft specific, and not clean enough for me. The derivated methods that return the widget are written one by one by hand; ugtk2 goal is not to be exhaustive, but reduced to the need of mandrakesoft coders, so it is useless for external coders. In addition, the derivated methods are not object oriented, you need to call the explicitely. And a lot of helpers functions use specific things related to the MandrakeLinux installer, config tools, or Interactive.

OK now to the documentation :

DESCRIPTION ^

DERIVATED METHODS

Not all methods are wrapped so that they can be called with a trailing _ to return the widget. If you need one that is not yet done, mail me at <dams@gentoo.org>

implemented derivated methods

the derivated methods are implemented only for original methods that return nothing (void). Here is the list of derivated methodes, ordered by classes:

Gdk

Gtk2::Gdk::Colormap
 free_colors rgb_find_color
Gtk2::Gdk::Device
 set_axis_use set_key set_source 
Gtk2::Gdk::Display
 beep close set_double_click_time grab keyboard_ungrab pointer_ungrab
 put_event sync ungrab
Gtk2::Gdk::DragContext
 abort drop finish set_icon_default set_icon_pixbuf set_icon_pixmap
 set_icon_stock set_icon_widget
Gtk2::Gdk::Drawable
 set_colormap draw_arc draw_drawable draw_gray_image draw_image
 draw_indexed_image draw_layout draw_layout_with_colors draw_line draw_lines
 draw_pixbuf draw_point draw_points draw_polygon draw_rectangle
 draw_rgb_32_image draw_rgb_32_image_dithalign draw_rgb_image
 draw_rgb_image_dithalign draw_segments
Gtk2::Gdk::Event
 set_screen
Gtk2::Gdk::GC
 set_background set_clip_mask set_clip_origin set_clip_rectangle
 set_clip_region set_colormap copy set_dashes set_exposures set_fill
 set_font set_foreground set_function set_line_attributes offset
 set_rgb_background set_rgb_bg_color set_rgb_fg_color set_rgb_foreground
 rgb_gc_set_background rgb_gc_set_foreground set_stipple set_subwindow
 set_tile set_ts_origin set_values
Gtk2::Gdk::PixbufAnimationIter
 composite composite_color copy_area fill render_threshold_alpha
 render_to_drawable render_to_drawable_alpha saturate_and_pixelate save
 scale
Gtk2::Gdk::PixbufLoader
 close set_size
Gtk2::Gdk::Region
 intersect offset shrink subtract union union_with_rect xor
Gtk2::Gdk::Screen
 broadcast_client_message set_default_colormap
Gtk2::Gdk::Window
 set_background begin_move_drag begin_paint_rect begin_paint_region
 begin_resize_drag set_child_shapes clear clear_area clear_area_e set_cursor
 set_debug_updates set_decorations deiconify destroy
 end_paint set_events focus freeze_updates fullscreen set_functions
 gdk_set_sm_client_id set_geometry_hints set_group hide
 set_icon_list set_icon_name set_icon iconify invalidate_rect
 invalidate_region lower maximize merge_child_shapes set_modal_hint move
 move_resize set_override_redirect process_all_updates
 process_updates property_change property_delete raise register_dnd reparent
 resize set_role scroll shape_combine_mask shape_combine_region show
 show_unraised set_skip_pager_hint set_skip_taskbar_hint stick thaw_updates
 set_title set_transient_for set_type_hint unfullscreen unmaximize unstick
 set_user_data withdraw

Gtk

Gtk2::AccelGroup
 connect connect_by_path lock unlock 
Gtk2::AccelLabel
 set_accel_widget
Gtk2::Adjustment
 changed clamp_page value_changed set_value
Gtk2::Alignment
 set
Gtk2::Arrow
 set
Gtk2::AspectFrame
 set_params
Gtk2::Bin
 child get_child
Gtk2::Box
 set_child_packing set_homogeneous pack_end pack_end_defaults pack_start
 pack_start_defaults reorder_child set_spacing
Gtk2::Button
 clicked enter set_label leave pressed released set_relief set_use_stock
 set_use_underline
Gtk2::ButtonBox
 set_child_secondary set_layout  
Gtk2::Calendar
 clear_marks display_options set_display_options freeze marked_date month
 num_marked_dates select_day selected_day thaw year
Gtk2::CellEditable
 editing_done remove_widget start_editing 
Gtk2::CellRenderer
 set_fixed_size render 
Gtk2::CellRendererText
 set_fixed_height_from_font  
Gtk2::CellRendererToggle
 set_active set_radio  
Gtk2::CheckMenuItem
 set_active set_inconsistent set_show_toggle toggled 
Gtk2::Clipboard
 clear set_text request_text request_contents
Gtk2::ColorSelection
 set_current_alpha set_current_color set_has_opacity_control set_has_palette
 set_previous_alpha set_previous_color
Gtk2::Combo
 set_case_sensitive disable_activate set_item_string set_popdown_strings
 set_use_arrows_always set_use_arrows set_value_in_list
Gtk2::Container
 add add_with_properties set_border_width check_resize child_set
 child_set_property set_focus_chain set_focus_child set_focus_hadjustment
 set_focus_vadjustment propagate_expose set_reallocate_redraws remove
 resize_children set_resize_mode unset_focus_chain
Gtk2::Curve
 set_curve_type set_gamma set_range reset set_vector
Gtk2::Dialog
 add_action_widget add_buttons set_default_response set_has_separator
 response set_response_sensitive
Gtk2::DrawingArea
 size
Gtk2::Editable
 copy_clipboard cut_clipboard delete_selection delete_text set_editable
 paste_clipboard set_position select_region get_selection_bounds
Gtk2::Entry
 set_activates_default append_text set_editable set_has_frame
 set_invisible_char set_max_length set_position prepend_text select_region
 set_text set_visibility set_width_chars
Gtk2::FileSelection
 complete set_filename hide_fileop_buttons set_select_multiple
 show_fileop_buttons
Gtk2::Fixed
 set_has_window move put  
Gtk2::FontSelection
 set_preview_text
Gtk2::FontSelectionDialog
 set_preview_text
Gtk2::Frame
 set_label
 set_label_widget
 set_shadow_type
 get_label_align
Gtk2::HandleBox
 set_handle_position set_shadow_type set_snap_edge
Gtk2::HButtonBox
 set_spacing_default set_layout_default
Gtk2::IconFactory
 add add_default remove_default 
Gtk2::IconSet
 add_source 
Gtk2::IconSource
 set_direction set_direction_wildcarded set_filename set_pixbuf set_size
 set_size_wildcarded set_state set_state_wildcarded
Gtk2::Image
 set_from_animation set_from_file set_from_icon_set set_from_image
 set_from_pixbuf set_from_pixmap set_from_stock
Gtk2::ImageMenuItem
 set_image
Gtk2::Invisible
 set_screen
Gtk2::Item
 deselect select toggle 
Gtk2::ItemFactory
 create_items delete_entries delete_entry delete_item
Gtk2::Label
 set_attributes set_justify set_label set_line_wrap set_markup
 set_markup_with_mnemonic set_mnemonic_widget set_pattern set_selectable
 set_text set_text_with_mnemonic set_use_markup set_use_underline
Gtk2::Layout
 freeze set_hadjustment move put set_size thaw set_vadjustment
Gtk2::List
 append_items clear_items end_drag_selection end_selection extend_selection
 insert_items prepend_items remove_items scroll_horizontal scroll_vertical
 select_all select_child select_item set_selection_mode start_selection
 toggle_add_mode toggle_focus_row toggle_row undo_selection unselect_all
 unselect_child unselect_item
Gtk2::ListItem
 deselect select 
Gtk2::ListStore
 clear set_column_types set move_after move_before reorder swap set_value
Gtk2::Menu
 set_accel_group set_accel_path set_active attach_to_widget detach popdown
 popup reorder_child reposition set_screen set_tearoff_state set_title
Gtk2::MenuItem
 set_accel_path activate deselect remove_submenu set_right_justified select
 set_submenu toggle_size_allocate
Gtk2::MenuShell
 activate_item append deactivate deselect insert prepend select_first
 select_item
Gtk2::Misc
 set_alignment set_padding  
Gtk2::Notebook
 set_current_page set_menu_label_text next_page popup_disable popup_enable
 prev_page remove_page reorder_child set_scrollable set_show_border
 set_show_tabs set_tab_border set_tab_hborder set_tab_label_packing
 set_tab_label_text set_tab_pos set_tab_vborder
Gtk2::OptionMenu
 new get_history set_history get_menu set_menu remove_menu
Gtk2::Paned
 add1 add2 child1_resize child1_shrink child2_resize child2_shrink
 compute_position pack1 pack2 set_position
Gtk2::Pango::Context
 set_base_dir set_font_description set_language 
Gtk2::Pango::FontDescription
 set_family set_family_static merge merge_static set_size set_stretch
 set_style unset_fields set_variant set_weight
Gtk2::Pango::Layout
 set_alignment set_attributes context_changed set_font_description
 set_indent set_justify set_markup set_single_paragraph_mode set_spacing
 set_tabs set_text set_width set_wrap
Gtk2::Pango::TabArray
 resize set_tab 
Gtk2::Plug
 construct construct_for_display 
Gtk2::ProgressBar
 set_fraction set_orientation pulse set_pulse_step set_text  
Gtk2::RadioButton
 set_group
Gtk2::RadioMenuItem
 set_group
Gtk2::Range
 set_adjustment set_increments set_inverted set_range set_update_policy
 set_value
Gtk2::Ruler
 draw_pos draw_ticks set_metric set_range  
Gtk2::Scale
 set_digits set_draw_value set_value_pos  
Gtk2::ScrolledWindow
 add_with_viewport set_hadjustment set_placement set_policy set_shadow_type
 set_vadjustment
Gtk2::SelectionData
 set 
Gtk2::SizeGroup
 add_widget set_mode remove_widget  
Gtk2::Socket
 add_id steal
Gtk2::SpinButton
 set_adjustment configure set_digits set_increments set_numeric set_range
 set_snap_to_ticks spin update set_update_policy set_value set_wrap
Gtk2::Statusbar
 set_has_resize_grip pop remove
Gtk2::Style
 apply_default_background set_background detach paint_arrow paint_box
 paint_box_gap paint_check paint_diamond paint_expander paint_extension
 paint_flat_box paint_focus paint_handle paint_hline paint_layout
 paint_option paint_polygon paint_resize_grip paint_shadow paint_shadow_gap
 paint_slider paint_tab paint_vline
Gtk2::Table
 attach attach_defaults set_col_spacing set_col_spacings set_homogeneous
 resize set_row_spacing set_row_spacings
Gtk2::TargetList
 add add_table remove  
Gtk2::TextAttributes
 copy_values
Gtk2::TextBuffer
 add_selection_clipboard apply_tag apply_tag_by_name begin_user_action
 copy_clipboard cut_clipboard delete delete_mark delete_mark_by_name
 end_user_action insert insert_at_cursor insert_child_anchor insert_pixbuf
 insert_range insert_with_tags insert_with_tags_by_name set_modified
 move_mark move_mark_by_name paste_clipboard place_cursor remove_all_tags
 remove_selection_clipboard remove_tag remove_tag_by_name set_text
Gtk2::TextIter
 forward_to_end set_line_index set_line_offset set_line set_offset order
 set_visible_line_index set_visible_line_offset
Gtk2::TextMark
 set_visible
Gtk2::TextTag
 set_piority
Gtk2::TextTagTable
 add remove 
Gtk2::TextView
 add_child_at_anchor add_child_in_window set_border_window_size set_buffer
 set_cursor_visible set_editable set_indent set_justification
 set_left_margin move_child set_pixels_above_lines set_pixels_below_lines
 set_pixels_inside_wrap set_right_margin scroll_mark_onscreen scroll_to_mark
 set_tabs set_wrap_mode
Gtk2::ToggleButton
 set_active set_inconsistent set_mode toggled 
Gtk2::Toolbar
 append_space append_widget set_icon_size insert_space insert_widget
 set_orientation prepend_space prepend_widget remove_space set_style
 set_tooltips unset_icon_size unset_style
Gtk2::Tooltips
 disable enable force_window set_tip  
Gtk2::TreeModel
 get_column_type get_flags foreach get iter_children get_iter_first
 get_iter_from_string get_iter iter_has_child iter_n_children iter_next
 iter_nth_child iter_parent get_n_columns get_path ref_node row_changed
 row_deleted row_has_child_toggled row_inserted rows_reordered
 get_string_from_iter unref_node get_value
Gtk2::TreeModelSort
 clear_cache reset_default_sort_func 
Gtk2::TreePath
 append_index down next prepend_index 
Gtk2::TreeSelection
 count_selected_rows iter_is_selected get_mode set_mode path_is_selected
 select_all set_select_function select_iter select_path select_range
 selected_foreach get_selected get_selected_rows get_tree_view
 unselect_all unselect_iter unselect_path unselect_range get_user_data
Gtk2::TreeSortable
 sort_column_changed set_sort_column_id set_sort_func  
Gtk2::TreeStore
 clear set_column_types set move_after move_before reorder swap set_value 
Gtk2::TreeView
 collapse_all columns_autosize set_cursor_on_cell set_drag_dest_row
 enable_model_drag_dest enable_model_drag_source set_enable_search
 expand_all expand_to_path set_expander_column set_hadjustment
 set_headers_clickable set_headers_visible insert_column_with_attributes
 set_model move_column_after set_reorderable row_activated set_rules_hint
 scroll_to_point set_search_column unset_rows_drag_dest
 unset_rows_drag_source set_vadjustment widget_to_tree_coords
Gtk2::VButtonBox
 set_layout_default set_spacing_default
Gtk2::TreeViewColumn
 add_attribute set_alignment set_attributes cell_set_cell_data clear
 clear_attributes set_clickable clicked set_fixed_width focus_cell
 set_max_width set_min_width pack_end pack_start set_reorderable
 set_resizable set_sizing set_sort_column_id set_sort_indicator
 set_sort_order set_spacing set_title set_visible set_widget
Gtk2::Viewport
 set_hadjustment set_shadow_type set_vadjustment
Gtk2::Widget
 set_accel_path add_accelerator add_events app_paintable set_app_paintable
 can_default can_focus child_notify set_child_visible set_colormap
 composite_child set_composite_name set_default_colormap
 set_default_direction destroy set_direction
 double_buffered set_double_buffered drag_dest_set drag_dest_set_proxy
 drag_dest_set_target_list drag_dest_unset drag_get_data drag_highlight
 drag_source_set drag_source_set_icon drag_source_set_icon_pixbuf
 drag_source_set_icon_stock drag_source_unset drag_unhighlight drawable
 ensure_style set_events set_extension_events set_flags freeze_child_notify
 grab_default grab_focus has_default has_focus has_grab hide hide_all
 is_sensitive map mapped modify_base modify_bg modify_fg modify_font
 modify_style modify_text set_name no_window parent_sensitive set_parent
 set_parent_window pop_colormap pop_composite_child
 propagate_event push_colormap set_size_request
 push_composite_child queue_draw queue_draw_area
 queue_resize rc_style realize realized receives_default
 set_redraw_on_allocate reparent reset_rc_styles reset_shapes
 selection_add_target selection_add_targets selection_clear_targets
 selection_remove_all sensitive set_sensitive shape_combine_mask show
 show_all show_now size_allocate set_state set_style thaw_child_notify
 toplevel unmap unparent unrealize unset_flags visible
Gtk2::Window
 add_accel_group add_embedded_xid add_mnemonic set_auto_startup_notification
 begin_move_drag begin_resize_drag set_decorated set_default_icon_from_file
 set_default_icon_list set_default
 set_default_size deiconify set_destroy_with_parent set_frame_dimensions
 fullscreen set_geometry_hints set_gravity set_has_frame
 set_icon_from_file set_icon_list set_icon iconify maximize
 set_mnemonic_modifier set_modal move set_position present
 remove_accel_group remove_embedded_xid remove_mnemonic
 reshow_with_initial_size set_resizable resize set_role set_screen
 set_skip_pager_hint set_skip_taskbar_hint stick set_transient_for
 set_type_hint unfullscreen unmaximize unstick set_wmclass set_title
Gtk2::WindowGroup
 add_window remove_window  

Gtk

Gnome2::App
 add_dock_item add_toolbar set_contents create_menus create_toolbar
 enable_layout_config insert_menus install_menu_hints set_menus
 remove_menu_range remove_menus set_statusbar_custom set_statusbar
 set_toolbar
Gnome2::AppBar
 clear_prompt clear_stack set_default install_menu_hints pop
 set_progress_percentage set_prompt push refresh set_status
Gnome2::AppHelper
 install_menu_hints_ 
Gnome2::Bonobo::Dock
 add_floating_item_ add_item_ allow_floating_items_ set_client_area_ 
Gnome2::Bonobo::Dock
 set_shadow_type_ 
Gnome2::Canvas
 set_center_scroll_region_ set_dither_ set_pixels_per_unit_ request_redraw_ 
 set_scroll_region_ scroll_to_ set_stipple_origin_ update_now_ 
Gnome2::Canvas::Bpath
 set_path_def_ 
Gnome2::Canvas::Item
 affine_absolute_ affine_relative_ grab_focus_ hide_ lower_ lower_to_bottom_ move_ 
 raise_ raise_to_top_ reparent_ request_update_ reset_bounds_ show_ ungrab_ 
 update_bbox_ 
Gnome2::Canvas::PathDef
 closepath_ closepath_current_ curveto_ ensure_space_ finish_ lineto_ 
 lineto_moving_ moveto_ reset_ 
Gnome2::Canvas::RichText
 set_buffer_ copy_clipboard_ cut_clipboard_ paste_clipboard_ 
Gnome2::Canvas::Shape
 set_path_def_ 
Gnome2::Client
 add_static_arg_ set_clone_command_ connect_ set_current_directory_ 
 set_discard_command_ disconnect_ set_environment_ flush_ 
 set_global_config_prefix_ set_priority_ request_interaction_ request_phase_2_ 
 request_save_ set_resign_command_ set_restart_command_ set_restart_style_ 
 save_any_dialog_ save_error_dialog_ set_shutdown_command_ 
Gnome2::ColorPicker
 set_d_ set_dither_ set_i16_ set_i8_ set_title_ set_use_alpha_  
Gnome2::DateEdit
 set_flags_ set_popup_range_ set_time_  
Gnome2::Druid
 append_page_ set_buttons_sensitive_ insert_page_ set_page_ prepend_page_ 
 set_show_finish_ set_show_help_ 
Gnome2::DruidPage
 finish_ prepare_ 
Gnome2::DruidPageEdge
 set_bg_color_ set_logo_bg_color_ set_logo_ set_text_color_ set_text_ 
 set_textbox_color_ set_title_color_ set_title_ set_top_watermark_ set_watermark_ 
Gnome2::DruidPageStandard
 append_item_ set_background_ set_contents_background_ set_logo_background_ 
 set_logo_ set_title_foreground_ set_title_ set_top_watermark_ 
Gnome2::DruidPageStandard
 append_history_ clear_history_ set_history_id_ set_max_saved_ prepend_history_ 
Gnome2::FileEntry
 set_default_path_ set_directory_entry_ set_filename_ set_modal_ set_title_ 
Gnome2::FontPicker
 fi_set_show_size_ fi_set_use_font_in_label_ set_mode_ set_preview_text_ set_title_ 
 uw_set_widget_ 
Gnome2::GConf::Client
 add_dir_ clear_cache_ set_error_handling_ set_ get_list_ notify_remove_ get_pair_ 
 preload_ remove_dir_ suggest_sync_ 
Gnome2::GConf::Engine
 notify_remove_ remove_dir_ suggest_sync_ 
Gnome2::HRef
 set_label_ set_text_ set_url_ 
Gnome2::IconEntry
 set_browse_dialog_title_ set_history_id_ set_max_saved_ set_pixmap_subdir_ 
Gnome2::IconList
 clear_ set_col_spacing_ focus_icon_ freeze_ set_hadjustment_ set_icon_border_ 
 set_icon_width_ insert_ insert_pixbuf_ moveto_ remove_ set_row_spacing_ 
 select_icon_ set_selection_mode_ set_separators_ set_text_spacing_ thaw_ 
 unselect_icon_ set_vadjustment_ 
Gnome2::IconSelection
 add_defaults_ add_directory_ clear_ select_icon_ show_icons_ stop_loading_ 
Gnome2::IconTextItem
 configure_ focus_ select_ setxy_ start_editing_ stop_editing_ 
Gnome2::IconTheme
 set_allow_svg_ append_search_path_ set_custom_theme_ prepend_search_path_ 
 set_search_path_ 
Gnome2::PasswordDialog
 set_password_ set_readonly_username_ set_username_ 
Gnome2::PixmapEntry
 set_pixmap_subdir_ set_preview_ set_preview_size_ 
Gnome2::PopupMenu
 add_popup_items_ append_from_ attach_to_ do_popup_ 
Gnome2::Print::Config
 dump_ 
Gnome2::Print::Dialog
 set_copies_ 
Gnome2::Print::FontPreview
 set_color_ set_font_ set_phrase_ 
Gnome2::Print::FontSelection
 set_font_ 
Gnome2::Print::GlyphList
 advance_ font_ glyph_ kerning_ letterspace_ moveto_ rmoveto_ text_dumb_ 
Gnome2::Print::UnitSelector
 add_adjustment_ set_bases_ remove_adjustment_ set_unit_  
Gnome2::Rsvg::Handle
 set_dpi_ set_size_callback_ 
Gnome2::Scores
 set_color_ set_colors_ set_current_player_ set_def_color_ set_logo_label_ 
 set_logo_label_title_ set_logo_pixmap_ set_logo_widget_ 
Gnome2::ThumbnailFactory
 create_failed_thumbnail_ save_thumbnail_  
Gnome2::VFS::Application
 add_mime_type_ set_bool_value_ clear_mime_types_ remove_application_ 
 remove_mime_type_ unset_key_ set_value_ 
Gnome2::VFS::Async::Handle
 cancel_ close_ read_ write_ 
Gnome2::VFS::Mime::Application
 save_ 
Gnome2::VFS::URI
 set_host_name_ set_host_port_ set_password_ set_user_name_  
Gnome2::Vte::Terminal
 set_allow_bold_ set_audible_bellâ_ set_background_image_file_ 
 set_background_image_ set_background_saturation_ set_background_tint_color_ 
 set_background_transparent_ set_backspace_binding_ set_color_background_ 
 set_color_bold_ set_color_dim_ set_color_foreground_ set_colors_ copy_clipboard_ 
 copy_primary_ set_cursor_blinks_ set_default_colors_ set_delete_binding_ 
 set_emulation_ set_encoding_ feed_ feed_child_ set_font_from_string_ set_font_ 
 im_append_menuitems_ match_clear_all_ match_remove_ match_set_cursor_ 
 match_set_cursor_type_ set_mouse_autohide_ paste_clipboard_ paste_primary_ 
 reset_ set_scroll_background_ set_scroll_on_keystroke_ set_scroll_on_output_ 
 set_scrollback_lines_ set_size_ set_visible_bell_ set_word_chars_ 
Gnome2::Window
 toplevel_set_title_ 
Gnome2::Wnck::Pager
 set_n_rows_ set_orientation_ set_screen_ set_shadow_type_ set_show_all_  
Gnome2::Wnck::Screen
 change_workspace_count_ force_update_ move_viewport_ release_workspace_layout_ 
 toggle_showing_desktop_ 
Gnome2::Wnck::Tasklist
 set_grouping_limit_ set_icon_loader_ set_include_all_workspaces_ 
 set_minimum_height_ set_minimum_width_ set_screen_ 
 set_switch_workspace_on_unminimize_ 
Gnome2::Wnck::Window
 activate_ activate_ activate_transient_ activate_transient_ close_ close_ 
 set_icon_geometry_ keyboard_move_ keyboard_size_ maximize_ 
 maximize_horizontally_ maximize_vertically_ minimize_ move_to_workspace_ pin_ 
 shade_ set_skip_pager_ set_skip_tasklist_ stick_ unmaximize_ 
 unmaximize_horizontally_ unmaximize_vertically_ unminimize_ unminimize_ unpin_ 
 unshade_ unstick_ 
Gnome2::Wnck::Workspace
 activate_ activate_ change_name_ 

METHODS for creation

These methods return a widget, ready to use. to use them you need to do :

  use Gtk2Fu qw(:create);
or 

  use Gtk2Fu qw(:all);
create_window()
 $widget = create_window($title, $type='toplevel', $resizable=1, $modal=0, $border_width=0, $delete_event=sub{})

Creates a window with specified properties.

create_entry()
  $entry = create_entry($text)

Creates an entry with a default text if provided.

create_full_menubar()
  $menubar = $window->create_full_menubar($menu_items=
                                          [
                                            [ "/_File" ,undef,0 ,0 ,"<Branch>" ],
                                            [ "/File/_New" ,"<control>N" ,\&callback,0 ,"<StockItem>" ,"gtk-new" ,"create a new file" ],
                                          ],
                                          $start_path='<main>');
  ($menubar, $factory) = $window->create_full_menubar($menu_items=
                                          [
                                            [ "/_File" ,undef,0 ,0 ,"<Branch>" ],
                                            [ "/File/_New" ,"<control>N" ,\&callback,0 ,"<StockItem>" ,"gtk-new" ,"create a new file" ],
                                          ],
                                          $start_path='<main>');

Creates a full menubar with menuitems of any type, and shortcuts. In scalar context, returns the menubar ready to be added in a box for instance. In list context, returns the menubar widget, and the factory, for advanced use. $start_path is optional.

create_scrolled_window()
  $viewport = $widget->create_scrolled_window($policy=['automatic','automatic'], $viewport_shadow)

Creates a scrolled viewport from a given $widget. Returns the viewport

METHODS for interaction with user

These methods create some widgets, launch a main loop, then return a value.

The ask_from_dialog methods display a dialog box and returns a value corresponding to the button clicked. The dialogs can take $options. $options is a HASHREF with keys/values that can be :

stock => STRING : an icon for the dialog box

cancel => BOOLEAN : if set to 1, a cancel button will be added

width => INTEGER : set a specific width to the dialog box

width => INTEGER : set a specific height to the dialog box

transient => BOOLEAN : set the transient state of the dialog box

use_markup => BOOLEAN : use markup or not

ask_from_info_dialog()
  $widget = ask_from_info_dialog($title, $label, $options={});

Information dialog

ask_from_warn_dialog()
 $widget = ask_from_warn_dialog($title, $label, {});

Warning dialog

ask_from_err_dialog()
 $widget = ask_from_err_dialog($title, $label, {});

Error dialog

ask_from_dialog()
  $widget = ask_from_dialog($title, $label, {});

Normal dialog

toolbox METHODS

Packing helpers methods. The methods aim to replace the pack_start and pack_end methods.

gtkpack()
  $widget = gtkpack($box, $widget1, $widget2, ...)

Packs $widgets in $box, with expand set to 1 and fill set to 1

gtkpack_()
  $widget = gtkpack_($box, 0 => $widget1, 1 => $widget2 ...)

Packs $widgets in $box, with fill set to 1. For each widget, the boolean set the expand property in the packing.

gtkpack__()
  $widget = gtkpack__($box, $widget1, $widget2, ...)

Packs $widgets in $box, with expand set to 0 and fill set to 1

gtkpack2()
  $widget = gtkpack2($box, $widget1, $widget2, ...)

Packs $widgets in $box, with expand set to 1 and fill set to 0

gtkpack2_()
  $widget = gtkpack2_($box, 0 => $widget1, 1 => $widget2 ...)

Packs $widgets in $box, with fill set to 0. For each widget, the boolean set the expand property in the packing.

gtkpack2__()
  $widget = gtkpack2__($box, $widget1, $widget2, ...)

Packs $widgets in $box, with expand set to 0 and fill set to 0

miscellaneous METHODS

miscellaneous helpers methods.

gtkflush()

flushes the pending iterations

EXAMPLE ^

  my $w = create_window()
    ->signal_connect_(destroy => sub { Gtk2->main_quit })
    ->set_size_request_(600, 450)
    ->set_border_width_(5)
    ->add_(Gtk2::VBox->new(0,5)
           ->gtkpack_(0, new Gtk2::HBox(0, 0)
                      ->gtkpack_(1, my $darea = Gtk2::DrawingArea->new()
                                    ->signal_connect_(expose_event => \&draw_banner),
                                 0, new Gtk2::VBox(0, 0)
                                    ->gtkpack_(1, '', 0, $arrow_button)
                                ),
                      1, Gtk2::HPaned->new()
                      ->pack1_(new Gtk2::VBox(0, 5)
                               ->gtkpack_(0, new Gtk2::HBox(0, 5)
                                             ->gtkpack_(0, my $search_entry = Gtk2::Entry->new(),
                                                        0, my $search_ok = Gtk2::Button->new('search'),
                                                        0, my $search_label = Gtk2::Label->new(),
                                                       ),
                                          1, $slist->create_scrolled_window()
                                         ), 1, 0
                              )
                      ->pack2_($hpan2 = new Gtk2::VBox(0, 5)
                               ->gtkpack_(0, Gtk2::HBox->new(0, 5)
                                             ->gtkpack_(0, 'flag name :',
                                                        1, my $flag_name = Gtk2::Entry->new()
                                                       ),
                                          0, Gtk2::HBox->new(0, 5)
                                             ->gtkpack__(my $flag_M = Gtk2::CheckButton->new('')
                                                           ->set_sensitive_(0),
                                                         'set in make.defaults'),
                                          0, Gtk2::HBox->new(0, 5)
                                             ->gtkpack__(my $flag_U = Gtk2::CheckButton->new('')
                                                           ->set_sensitive_(0),
                                                         'set in use.defaults'),
                                          0, Gtk2::HBox->new(0, 5)
                                             ->gtkpack__(my $flag_C = Gtk2::CheckButton->new('')
                                                           ->set_sensitive_(0),
                                                         'set in make.conf'),
                                          0, Gtk2::Label->new('description :')
                                             ->set_alignment_(0, 0.5),
                                          1, Gtk2::Frame->new()
                                             ->set_shadow_type_('in')
                                             ->add_($flag_description)
                                         ),
                               1, 0)->set_position_(400),
                      0, Gtk2::HButtonBox->new()
                         ->set_layout_('end')
                         ->gtkpack(Gtk2::Button->new('Cancel')
                                     ->signal_connect_(clicked => sub { Gtk2->main_quit }),
                                   Gtk2::Button->new('OK')
                                     ->signal_connect_(clicked => sub { main_ok() })
                                  )
                     )
          )
    ->show_all_();
  $darea->size(-1, 38);

AUTHOR ^

dams, <dams@cpan.org>

BUGS ^

Please report any bugs or feature requests to bug-gtk2fu@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Gtk2Fu. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE ^

Copyright 2005-2009 dams, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: