CONTENT="Modular DocBook HTML Stylesheet Version 1.52">|
Currently it is up to the calling application to appropriately setup the window hints for the application so the terminal will size properly (i.e. to the nearest character cell position). This can be set using the gtk function gtk_window_set_geometry_hints().
If the application's main window area is not the terminal then it may not make sense to set these hints - the terminal will still operate and resize correctly, but may be resized to fractions of a character cell, which will leave a blank space along the right and/or bottom edges.
Example 2. A realize signal handler which sets the window hints for character-accurate window resizing.
The example above sets the window hints so that the window manager will force resizes to the nearest character, and report the character dimensions if it provides that functionality.
It should be attached to the terminal instance using gtk_signal_connect_after() so that the hints are set after the window is realized.
Example 3. Attaching the realize handler to the terminal
It must also be called whenever the font is changed, to get the correct behavior. Only do this if the terminal is realized. Simply call this set_hints() function immediately after calling one of the zvt_term_set_font*() functions, after checking that the given terminal is actually realized (using GTK_WIDGET_IS_REALIZED()).