Changeset 853f397


Ignore:
Timestamp:
Jun 3, 2010, 1:36:06 PM (7 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
840032d
Parents:
8f9a044
Message:
Make mainpanel's fill_parent_cb also generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • mainpanel.c

    rfa65671 r853f397  
    11#include "owl.h"
    2 
    3 static void owl_mainpanel_size(owl_window *parent, void *user_data);
    42
    53void owl_mainpanel_init(owl_mainpanel *mp)
     
    1311
    1412  /* Set up sizing hooks */
    15   owl_signal_connect_object(owl_window_get_screen(), "resized", G_CALLBACK(owl_mainpanel_size), mp->panel, 0);
     13  owl_signal_connect_object(owl_window_get_screen(), "resized", G_CALLBACK(owl_window_fill_parent_cb), mp->panel, 0);
    1614  g_signal_connect_swapped(mp->panel, "resized", G_CALLBACK(owl_mainpanel_layout_contents), mp);
    1715
    1816  /* Bootstrap the sizes and go */
    19   owl_mainpanel_size(owl_window_get_screen(), mp->panel);
     17  owl_window_fill_parent_cb(owl_window_get_screen(), mp->panel);
    2018  owl_window_show_all(mp->panel);
    21 }
    22 
    23 static void owl_mainpanel_size(owl_window *parent, void *user_data)
    24 {
    25   int lines, cols;
    26   owl_window *panel = user_data;
    27 
    28   /* Make this panel full-screen */
    29   owl_window_get_position(parent, &lines, &cols, NULL, NULL);
    30   owl_window_set_position(panel, lines, cols, 0, 0);
    3119}
    3220
  • window.h

    r8f9a044 r853f397  
    5858
    5959void owl_window_erase_cb(owl_window *w, WINDOW *win, void *user_data);
     60void owl_window_fill_parent_cb(owl_window *parent, void *user_data);
    6061
    6162G_END_DECLS
  • windowcb.c

    r8f9a044 r853f397  
    66  owl_window_dirty_children(w);
    77}
     8
     9void owl_window_fill_parent_cb(owl_window *parent, void *user_data)
     10{
     11  int lines, cols;
     12  owl_window *window = user_data;
     13
     14  /* Make this panel full-screen */
     15  owl_window_get_position(parent, &lines, &cols, NULL, NULL);
     16  owl_window_set_position(window, lines, cols, 0, 0);
     17}
Note: See TracChangeset for help on using the changeset viewer.