message window on wrong monitor
Posted
#1
(In Topic #709)
Enthusiast

example…
message.info("Hey, you forgot something") This appears somewhat randomly and never where I want to place it. How can I make it go where I want it?
Posted
Guru

Try this as a possible solution: -
Code (gambas)
- ' Gambas class file
- .Height = 400
- .Width = 500
- .Padding = 5
- .Arrangement = Arrange.None
- .Center
- .X = 200
- .Y = 350
- .H = 28
- .W = 112
- .Text = "&Click me!"
- .H = 100
- .W = 350
- .Show
- .X = 10
- .Y = 15
- .H = 28
- .W = 350
- .Alignment = Align.Center
- .Text = "Hey, you forgot something."
- .X = 200
- .Y = 70
- .H = 28
- .W = 112
- .Text = "&OK"
- NewMessage.Close
Posted
Enthusiast

Posted
Regular

sadams54 said
…Is there a way to control where the window appears?
I don't know, but take a look at wmctrl which can move the active window to another workspace;
Code
wmctrl -r :ACTIVE: -t 2…will send active window to workspace 3 …I can't remember whether extra monitors are like additional workspaces.
Posted
Enthusiast

when using multiple monitors the x and or y attributes are essentially doubled making the monitors a single entity. so to put something on a particular monitor you would have to set the x or y values beyond the first monitor and into the field of the desired monitor. So workspaces are totally different in that respect.
Posted
Regular

sadams54 said
…when using multiple monitors the x and or y attributes are essentially doubled making the monitors a single entity. so to put something on a particular monitor you would have to set the x or y values beyond the first monitor and into the field of the desired monitor…
OK, I'm probably missing something here, but if the display is just spread over a number of monitors, why can't you do what you say above?
e.g. to place form on required display
Code
frmMessage.Left = Screen.Width * MonitorNumber
Posted
Enthusiast

sadams54 said
This appears somewhat randomly
some strange twisted logic is definitely behind it … maybe the messagebox appears on the monitor where the application with the focus is running?
if i skimmed the qt documentation correctly there is no way to determine the position there either … so if you really want to define where the messagebox appears you have to program it yourself …
interesting should be the calculation of the monitor … negative x values for everything left of the primary monitor plus the respective y offsets for the different vertical positions … well have fun
Posted
Enthusiast

1 guest and 0 members have just viewed this.


