hello Ian,

I'm implementing a roulette table, each number on the table is a custom
made widget (derived from Gtk::Widget).
Top widget is a Gtk::Grid, The grid attaches child widgets, in the end
there is a grid of 3 x 12 visible child widgets. (number fields),

I'm assuming you didn't player roulette...
when you place a chip on, let's say on.. half a number, the widget will
draw one half of a chip, and its neighboring widget is signaled to draw the
other half (so that entry chip is drawn on the table )
The widget who sends a signal also sends coordinates on where to draw.  the
child widgets are interconnected by signals to their neighboring widgets.

However the table, that is their parent(Gtk::Grid) might change from
vertical to horizontal view of the table, in that case child widgets
(numbers) and their neighboring widgets are reordered and do not have the
same coordinate system any more, and x y points that were valid in vertical
view will be wrong in that horizontal view because signal handlers of
neighboring widgets are fixed to vertical table not horizontal.

This might be better illustrated by looking at following 2 images,
(vertical numbers and horizontal numbers)
http://www.bettingcorp.com/wp-content/ups/european-roulette-table2.jpg
http://www.outsidebet.net/wp-content/uploads/even-chance-bets.jpg

So I want to change the view of the table and preserve coordinate system of
child widgets, otherwise I need to reconnect all child widget handlers to
different signals so that chips get drawn correctly.

I would like to post a code but there is a lot of it.
It could be my design is bad, so any design recommendations specific for
this case is welcome.




On Tue, Dec 15, 2015 at 10:51 PM, Ian Martin <[email protected]>
wrote:

> Hi,
> From that description I don't understand where the x/y coordinates you
> want are coming from or going to, or what they're relative to.  Are you
> trying to deduce the signal's location within the widget you're clicking
> on, or the location of the widget clicked on within the Gtk::Window?  Or is
> the problem that you're connecting a signal, but when that signal gets
> activated it's passing location data that's no longer correct?
>
> Some code might make things clearer.
>
> Ian.
>
>
> On 16/12/15 07:36, codekiddy wrote:
>
> Hello, not sure if this is right question, but I have a case where a top
> widget might reorder positions of it's child widgets (rotate them in some
> fashion for 90 degrees).
> However child widgets are connecting signals with each other and these
> signals depend on x y coordinates of Gdk::Window for.
> once the top widgets reorders it's childs their signals are wrong since
> coordinate system is not the same any more, to avoid duplicating code for
> each reorder of widgets with signals connecting to different handlers I
> wonder is there is a way
> to just rotate the Gdk::Window of child widgets in order to preserve it's
> old x and y?
>
> I see there is a Gdk::Window::move_resize() function but this function
> moves the Gdk::Window, and does not provide ability to rotate it. (I might
> be wrong)
>
> any hints are welcome.
> thanks.
>
>
> _______________________________________________
> gtkmm-list mailing 
> [email protected]https://mail.gnome.org/mailman/listinfo/gtkmm-list
>
>
>
> _______________________________________________
> gtkmm-list mailing list
> [email protected]
> https://mail.gnome.org/mailman/listinfo/gtkmm-list
>
>
_______________________________________________
gtkmm-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to