Re: Display simple box indicating position on mouse click?



Sorry Toralf,

My bad.. use Gtk::Dialog instead of Gtk::MessageDialog.

Bob

Toralf Lund wrote:

Bob Caryl wrote:

Hey Toralf,

You can connect a callback to your signal_button_press_event that would displaying the mouse coordinates in a Gtk::MessageDialog that has no buttons added to it and with all its decorations turned off...


Yes. I considered that earlier, but thought I might ask first in case there was an even simpler way...

Anyhow, I've now tried this, and it nearly looks the way I want, but there is one problem: The message dialog will also contain an icon indicating the message type. I don't want that, but I can't seem to find a way to disable it.

that would make it resemble a tool tip; and, since it would have focus, you could close it when it receives the release event. Just a thought.


Possibly a dumb question, but how exactly can I do that? I thought that it would go away if I did

msgBox.clear();

after creating as

Glib::RefPtr<Gtk::MessageDialog> msgBox=new Gtk::MessageDialog(*this, msg, Gtk::MESSAGE_INFO, Gtk::BUTTONS_NONE);

but it doesn't.


Bob Caryl

Toralf Lund wrote:

In one of my applications, I'd like to display the pointer position (within the widget) when a certain mouse button (I haven't decided which) is clicked, in some kind of a popup box. Any suggestions about how to achieve this? I mean, to capture the actual click and get the position, I can probably just connect to signal_button_press_event() - or possibly signal_button_release_event(), but what's the best way of actually displaying the information? Maybe I want something rather like the standard tooltips, but I don't know how to force display of those...

- Toralf

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list








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