window

Dividing a CDialog in two areas with different backgrounds (picture of the objective inside)

本秂侑毒 提交于 2020-01-06 05:01:06
问题 I need to build a window designed to look exactly like this (it has controls inside the white area, but that's not relevant for now): http://dl.dropbox.com/u/3432167/example.png My problem is defining those two separate "areas" with different backgrounds. The closest I've got to the expected look was representing the white area with an empty ListBox, but the result is not the same (and it is a lousy hack). Any ideas on how achieve this? 回答1: If the dialog does not need to be resizable, the

Change the window's opacity / hide it without affecting its childs

六眼飞鱼酱① 提交于 2020-01-06 01:45:26
问题 I simply have a drawing area, contained in a GtkWindow toplevel. How can I hide the window / make it fully transparent without doing that to its children too (in that case the the drawing area) ? I am aiming to the case in which everything drawn by the program is just the canvas drawing. 来源: https://stackoverflow.com/questions/32534734/change-the-windows-opacity-hide-it-without-affecting-its-childs

Use window.open in a directive

爷,独闯天下 提交于 2020-01-05 12:08:59
问题 I am trying to trigger $window.open(url, windowName, attributes); in my angular app with a ng-click I have defined a directive and wrap window.open in a function trigger thanks to an ng-click linked to a button on my template: myApp.directive('myModal', ['$log', function ($log, $window) { return { restrict: 'E', templateUrl: 'modal-tpl', replace: true, transclude: true, link: function (scope, window) { scope.openWindow = function(){ window.open('https://myLink', 'Google', 'width=500,height

javascript change body ID (with css) dynamically with respect to browser window size

做~自己de王妃 提交于 2020-01-05 07:50:28
问题 Here is what I have, but it is not working: if(window.width() < 1000) document.getElementsByTagName('body')[0].id="be" else document.getElementsByTagName('body')[0].id="bd" ; Please tell me what I am writing wrong. Please don't tell other solutions, please just fix this code. Basically, I want to give a different ID to the BODY tag of a website if the browser window size is less than 1000px. 回答1: Here you go: document.body.id = window.innerWidth < 1000 ? 'be' : 'bd'; Place this code at the

Window not closing GLFW

烈酒焚心 提交于 2020-01-05 07:33:51
问题 I am writing a game engine in OpenGL and GLFW. However, somehow my window can't be closed. I tried many things but it doesn't have effect. What's wrong with my code? I can't find the wrong thing in it - everything seems fine to me. Code: int running; GLFWwindow* window; Window::~Window() { glfwTerminate(); } Window::Window(int width, int height, const std::string& title) : m_width(width), m_height(height), m_title(title){ glfwInit(); if (!glfwInit()) glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);

Matlab - 8x8 window and finding mean

随声附和 提交于 2020-01-05 03:27:19
问题 Say I have a matrix of an image, and I want to do the following: Slide an 8x8 window over the matrix Calculate the mean for each pixel in the matrix How can I do that in matlab , provided that I'm kind of new to coding in matlab. Thanks. 回答1: You could use conv2 with a ones(8) filter, as in I2 = conv2(I, 1.0 / 64.0 * ones(8), 'valid'); . We divide by 64.0 because the "filter" isn't normalized. 回答2: You can also use nlfilter : fun = @(x) mean(x(:)); ans= nlfilter(img,[8 8],fun); But as @s

Matlab - 8x8 window and finding mean

試著忘記壹切 提交于 2020-01-05 03:27:07
问题 Say I have a matrix of an image, and I want to do the following: Slide an 8x8 window over the matrix Calculate the mean for each pixel in the matrix How can I do that in matlab , provided that I'm kind of new to coding in matlab. Thanks. 回答1: You could use conv2 with a ones(8) filter, as in I2 = conv2(I, 1.0 / 64.0 * ones(8), 'valid'); . We divide by 64.0 because the "filter" isn't normalized. 回答2: You can also use nlfilter : fun = @(x) mean(x(:)); ans= nlfilter(img,[8 8],fun); But as @s

setDefaultCloseOperation not working in Swing

☆樱花仙子☆ 提交于 2020-01-04 13:31:29
问题 I need to stop the default operation of window being closed when red x mark is clicked on the swing window. I am using the JDialog and adding WindowsListener to it to capture the WindowClosing event, there I decide whether to dispose JDialog or to not dispose it, I am also setting the following: setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); But still when I click on the red x mark, the window closes. Any ideas? 回答1: Adding Window listener to the JDialog gave me the power to handle

setDefaultCloseOperation not working in Swing

守給你的承諾、 提交于 2020-01-04 13:31:27
问题 I need to stop the default operation of window being closed when red x mark is clicked on the swing window. I am using the JDialog and adding WindowsListener to it to capture the WindowClosing event, there I decide whether to dispose JDialog or to not dispose it, I am also setting the following: setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); But still when I click on the red x mark, the window closes. Any ideas? 回答1: Adding Window listener to the JDialog gave me the power to handle

Jquery toggle on window minimize

荒凉一梦 提交于 2020-01-04 09:25:39
问题 I have a div that toggles in and out of display when you click on another div. How could I modify my code so that when the user minimizes the whole browser window it automatically toggles, hiding the div from view so when the user un-minimizes window the div is no longer visible. 回答1: Minimizing the window (or switching to another application) should fire the window.onblur event. Activating the window should fire window.onfocus Implementation details may differ slightly between browsers but