Class Demo::ChangeDisplay
In: gtk/sample/gtk-demo/changedisplay.rb
Parent: Gtk::Dialog

Methods

Constants

DISPLAY_COLUMN_DISPLAY = 0, 1
SCREEN_COLUMN_SCREEN = 0, 1

Public Class methods

Main entry point. If the dialog for this demo doesn‘t yet exist, creates it. Otherwise, destroys it.

Public Instance methods

Adds a new display to our list of displays, and connects to the ‘closed’ signal so that we can remove it from the list of displays again.

Creates the ‘Display’ frame in the main window.

This function is used both for creating the ‘Display’ and ‘Screen’ frames, since they have a similar structure. The caller hooks up the right context for the value returned in tree_view, and packs any relevant buttons into button_vbox.

Creates the ‘Screen’ frame in the main window.

Called when the selected row in the display list changes. Updates info.current_display, then refills the list of screens.

Called when one of the currently open displays is closed. Remove it from our list of displays.

Fills in the screen list based on the current display

Finds the toplevel window under the mouse pointer, if any.

Adds all currently open displays to our list of displays, and set up a signal connection so that we‘ll be notified when displays are opened in the future as well.

If we have a stack of buttons, it often looks better if their contents are left-aligned, rather than centered. This function creates a button and left-aligns it contents.

Called when the user clicks on ‘Open…’ in the display frame. Prompts for a new display, and then opens a connection to that display.

Prompts the user for a toplevel window to move, and then moves that window to the currently selected display

Asks the user to click on a window, then waits for them click the mouse. When the mouse is released, returns the toplevel window under the pointer, or nil, if there is none.

[Validate]