Re: scrollbar once again



Ronald Bultje <rbultje ronald bitfreak net> writes:
> 1) if I close the Gtk-app, control doesn't return to the terminal, so it
> locks somewhere - how do I find out where?

Do you gtk_main_quit() to exit gtk_main()?

To find out where, just run 'gdb myapp', then after closing the app, 
hit Ctrl-C and type "backtrace"

> 2) I cannot grab the keyboard keys (I tried
> gtk_signal_connect(GTK_WIDGET(enhanced_slider), "key_press_event",
> (GtkSignalFunc)gtk_enhanced_scale_key_press, NULL);, but that didn't work)

You need to handle focus with handlers like this:

static gboolean
gtk_scalethingy_focus_in_event (GtkWidget     *widget,
                                GdkEventFocus *event)
{
  GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
  gtk_widget_queue_draw (widget);

  return FALSE;
}

static gboolean
gtk_scalethingy_focus_out_event (GtkWidget     *widget,
                                  GdkEventFocus *event)
{
  GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
  gtk_widget_queue_draw (widget);

  return FALSE;
}

Also, probably when you get a button press you want to
gtk_grab_focus().

Havoc





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