Class | Demo::ChangeDisplay |
In: |
gtk/sample/gtk-demo/changedisplay.rb
|
Parent: | Gtk::Dialog |
DISPLAY_COLUMN_DISPLAY | = | 0, 1 |
SCREEN_COLUMN_SCREEN | = | 0, 1 |
Main entry point. If the dialog for this demo doesn‘t yet exist, creates it. Otherwise, destroys it.
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.
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.
Called when the selected row in the display list changes. Updates info.current_display, then refills the list of screens.
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