Re: Gtk2::Assistant: Access to Buttons




On Jul 3, 2007, at 1:59 PM, Torsten Schoenfeld wrote:

On Tue, 2007-07-03 at 18:21 +0200, Peter Daum wrote:

To make usage as convenient as possible, I would like the return key to always do the next logical step (focus the next entry field or trigger the "forward"
button)

The first thing to come to mind is to be sure to set activates- default on the Entries you add to your Assistant (it appears from your code snippet that you did that already), and then set the Forward button to be the default. But, there's no way to get to the Forward button without either walking the widget tree or adding a struct binding:

Indeed, there seems to be no convenient way to do this in the Perl
bindings.  The only way I see is:

  $e1->signal_connect(activate => sub {
    $assistant->set_current_page ($assistant->get_current_page + 1);
  });

Although they are not documented, the C header file does export struct
members corresponding to the buttons:

  struct _GtkAssistant
  {
    GtkWindow  parent;

    GtkWidget *cancel;
    GtkWidget *forward;
    GtkWidget *back;
    GtkWidget *apply;
    GtkWidget *close;
    GtkWidget *last;

    /*< private >*/
    GtkAssistantPrivate *priv;
  };

So you actually can access the buttons from C and I wonder if we should
provide accessors in the bindings?

The fact that there's a priv pointer *and* these members in the instance seems to indicate that the idea is to make the buttons available via the instance. However, gtk+ has a policy of "instance members are private unless otherwise stated"... No other bindings appear to wrap these instance members.

So, to the gtk+ developers: are these fields something we should expose in language bindings?


--
One, two, free, four, five, six, sebben, eight, nine, ten, elebben, twull, fourteen, sickteen, sebbenteen, eightteen, elebbenteen, fiffeen, elebbenteen!
  -- Zella, aged three, counting to twenty.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]