Monday, August 3, 2020
How to Cope When Your Spouse Is Gay
How to Cope When Your Spouse Is Gay Relationships Spouses & Partners Marital Problems Print How to Cope When Your Spouse Is Gay By Sheri Stritof Sheri Stritof has written about marriage and relationships for 20 years. Shes the co-author of The Everything Great Marriage Book. Learn about our editorial policy Sheri Stritof Updated on November 18, 2019 GlobalStock/Getty Images More in Relationships Spouses & Partners Marital Problems LGBTQ Violence and Abuse Youve had your suspicions. Maybe your normal sexual appetite is considered by your mate to be excessive, or your spouse doesnt want to have anything to do with you sexually and acts repulsed by sexual activity. Maybe your partner becomes more and more secretive and moody and you notice him or her looking at people of the same sex in a different way. Then you discover the truth: your spouse or partner is gay or bisexual. As your world turns upside down, and as your partner comes out, you find yourself reeling. You feel alone, isolated and ashamed. Statistics Concerning Mixed Orientation Couples Mixed orientation couples are those in which one member in a relationship is either gay, lesbian, bisexual, or transgendered. According to one study, there are up to 2 million mixed-orientation couples.?? When the gay, lesbian, or bisexual partner comes out, a third of the couples break up immediately; another third stay together for one to two years and then split; the remaining third try to make their marriages work. Of these, half split up, while the other half stay together for three or more years.?? Key Issues Facing a Straight Spouse Theres no question that learning your partner is gay or bisexual can be traumatic for the straight person in the relationship. Among the things you may be feeling are: Sexual rejectionDamaged sexual self-esteemWondering things like what did I do to cause this? or am I not masculine/feminine enough?Low self-image and a high level of self-doubtConcern about the children. How will they handle the news? How will it influence them to have a gay parent?Feeling like your beliefs have been shattered after living a lieConfusion about the relationship or marriage and whether it is worth savingFear of having your family torn apartHurt over being violated and lied toRage, bitterness, fear, shock, despair, devastation, repulsion, hurt and angerAnxiety about whether your partner or spouse has been unfaithfulShame, secrecy, and a fear of lack of acceptanceFear of having been exposed to or having contracted sexually transmitted diseases including HIV Things to Do and Not to Do Do Decide what you both can and cannot live with. Accept that it takes two to make a marriage. Get checked immediately for sexually transmitted diseases, whether or not your partner admits to any sexual infidelity. Take care of yourself as you go through the grieving process. Your relationship has changed. Try to accept this reality and move forward. Be careful how you tell your children. You may need professional guidance to deal with this. Its important for them to feel loved and secure and to know theyre not to blame for the situation. Don't Isolate yourself. Seek out a support group or professional help. Assume your marriage is over. Some straight/gay marriages are happy unions. However, studies show that out of 15 percent of couples who try to make it work, only about 7 percent make it over the long term. Blame yourself for turning your partner gay. No one can turn someone else gay. Let the years of deception and the sense of betrayal take away from the good times and the positive memories. A Word From Verywell Although the trauma of being a straight spouse or partner can be overwhelming, it is important to realize that the situation you find yourself in is not your fault. The first year will probably be the toughest as you sort out complicated feelings and decide how to move forward. These decisions may mean the end of your marriage. Some couples stay married and some dont. Moving on and letting go will take time and a willingness to forgive.
Saturday, May 23, 2020
Various Policies Of The Us Government Toward Native...
History 17B Midterm #1 Zack Jodry History 17B Professor Pritchard March 10th, 2015 Jodry 2 Part One: Explain the various policies of the US government toward Native American tribes, 1870-1890. Give concrete examples of these policies and various tribal responses to US government actions. Americaââ¬â¢s Gilded Age. A time where in the span of 20 years, a major amount of progress has made its way to our young nation. The Statue of Liberty made its debut on October 1886, Railroads became a new way of economic power and transportation of goods, and almost everyone moved out west to seek new lives with the hopes of fortune in mind. However, with America expanding and renovating itself after the endâ⬠¦show more contentâ⬠¦It was the beginning of the end not only for the homes of the natives, but their lifestyles would be changed too. ââ¬Å"The federal government pressed forward with its assault on Indian culture. The Bureau of Indian Affairs established boarding schools where Indian children, removed from the ââ¬Å"negativeâ⬠influences of their parents and tribes, were dressed in non-Indian clothes, given new names, and educated in white ways.â⬠Life would become increasingly difficult for our original settlers. But it was either conform to the â⬠Å"Americanâ⬠society or worse be removed completely. In 1887, The Dawes Act was issued by President Grover Cleveland in hopes of dividing every Indian land and selling it into smaller forms offering their own private property which was then auctioned off by white Americans. ââ¬Å"Indians who accepted the farms and ââ¬Å"adopted the habits of civilized lifeâ⬠would become full fledged American citizens.â⬠Many Indian men, women, and children had to leave their previous lives behind in order to have some sort of freedom. This meant cutting their hair short, wearing non traditional tribal clothing, and practicing christianity. However, few Indians were respected as American citizens because many of them couldnââ¬â¢t give up
Monday, May 11, 2020
Taking a Look at Capitalism - 581 Words
Capitalism is an economic system where goods and services are created for profit using privately owned goods and wage labor. The owners of these capital goods will employ wage labor to generate commodities with the aim of acquiring a personal profit. The owners, or the designated managers of these owners, make the majority of the business decisions and receive profit and other property revenue, including rent, interest, and dividends. Capitalism usually yields significant economic growth and inequality. Capitalisms foundational manifesto is usually accreditted to be Adam Smiths 1776 book Inquiry into the Nature and Causes of the Wealth of Nations, even though Smith based his work on mostly older concepts. It has in actuality been the dominant economic system in certain places of Europe since the 1600s. A naturally expansionary system from its earliest years, capitalism has infiltrated into most countries in the world. It has grown very unevenly; in some places it has been a strong instrument of growth and industrializationââ¬âas in the majority of Europe, the United States, and Japanââ¬âbut has, on the other hand, left other places of the world struggling financially and underdeveloped. Wherever capitalism has been implemented thoroughly, it has been and remains to be a powerful system for both positive and negative results. Globalization, the product of the fast-rising movement of capital all over the world, offers opportunities for large and expanded profits and low-cost goodsShow MoreRelatedThe Financial Crises Of 20081701 Words à |à 7 Pagessome it has been beneficial for others dire. Many people no longer have faith in the ââ¬Ëcapitalism that presents itself as a gospel of salvationââ¬â¢ (comaroff review, find) and are embracing alternatives to lassaire faire capitalism. The crises has seen the rise of anti-capitalist movements such as ( people before profit) offering an alternative vision to mainstream capitalism. In the EU the crises has forced people to look at alternative solutions, turning to/voting in both right wing populism/populist (parties)Read MoreThe Obligations Of An Eighteenth Century Merchant923 Words à |à 4 Pagesinitial trade networ ks that capitalism relied upon. In taking a broad based Atlantic perspective to capitalism Haggerty demonstrated that in order to understand the phenomenon historians will have to take an ever larger view of capitalist endeavors, they will have to step beyond Atlantic perspectives into a global or even transnational look at the subject. This is exactly what Sven Beckert attempts in Empire of Cotton: A global History. Beckert take on the study of capitalism by closely examining theRead MoreA Deeper Look At The Future Of Work1116 Words à |à 5 PagesTaking a deeper look at the future of work has never been so critical in todayââ¬â¢s society. Not only does one have to assess the working conditions within their own country but rather countries around the world because ultimately, we are one intertwined and whatever happens to one country will affect us in some way. Trying to discover what the future of work has in store for us is integral because as history indicates, being ignorant of the economy and its people can lead to disastrous events. TheRead MoreCapitalism Is A Way Of Organizing An Economy875 Words à |à 4 Pagesdocumentary Capitalism a Love Story examples what capitalism is and how it hurt so many citizens. Capitalism is a way of organizing an economy so that the things that are used to make and transp ort products are owned by individual people and companies rather than by the government. The documentary teaches viewers the impact that big corporations have on americans. At the beginning of the film Moore is showing middle class people get there houses taken from them because of capitalism. HenslinRead MoreKarl Marx and Capitalism Essay880 Words à |à 4 Pages developed his critique of capitalism by analyzing its characteristics and its development throughout history. The critique contains Marxââ¬â¢s most developed economic analysis and philosophical insight. Although it was written in 1850s, its values still serve an important purpose in the globalized world and maintains extremely relevant in the twenty-first century. Karl Marxââ¬â¢s critique of political economy provides a scientific understanding of the history of capitalism. Through Marxââ¬â¢s critique, theRead MoreMarx s Theory Of Capitalism882 Words à |à 4 Pagessome look at the United States of America as the land of free, the proverbial, land of milk and honey. Others argue that our nation is a corrupt land that is where only the affluent capitalists thrive while the rest of the country s workforce are heard through like cattle, only kept alive enough to keep them working to be the slaves of maintaining the gigantic corporations and business that they work for. This bleak look at the Americaââ¬â¢s foundation is conducted by Karl Marx, who saw capitalism asRead MorePerversions of Capitalism in Michael Moores Capitalism: A Love Story660 Words à |à 3 PagesCapitalism came into being as a social and economic system when private individuals or corporations--as opposed to the state or classes of people--began to build businesses w here the goal was profit motivated for the self-interest of the owner. This is opposed to a socialist system where the business may be owned by the state and/or profiting the state. In an ideal world, it is the economic establishment of the individual right for self-accomplishment. The private individual/corporation succeedsRead Morecriminology Essay941 Words à |à 4 Pagescontributors to this theory was Howard Becker who in 1963 wrote the book ââ¬Å"Outsidersâ⬠which provided the foundations of labelling theory. Becker looked at how social groups created deviance by creating the rules that classed certain acts as deviant. Labelling looks at how a person can be labelled a deviant by society thus becoming a deviant, if a person is labelled a drug taker or prostitute then they have a chance of becoming a drug taker or prostitue. Once a person had attained a deviant label then they wereRead MoreAnalysis Of From The Frying Pan Into The Fire 1506 Words à |à 7 PagesWhat d oes the middle-class family look like in the twenty-first century? Probably both men and women are working in order to make money to support families. Womenââ¬â¢s gender roles have changed significantly within fifty years. Because of Capitalism, women now have more rights than before, and some women now make more money than men. Capitalism combines the principle efficiency and the aim for profit, which presents as the more money one person can make shows the ability this person maintain. In ââ¬Å"FromRead MoreMarxisms Tools for Contemporary International Relations Essay1619 Words à |à 7 PagesAfter the collapse of the Soviet Union and the end of the Cold War between the Western Bloc and Eastern Bloc, the enduring ideological conflict between communism and capitalism was seen to come to an end. The global order has since entered into a neo-liberal capitalist era, with neo-liberal ideologies characterizing the various dimensions of the global order, such as international politi cs and economics. As the world is homogenizing into neo-liberal capitalist orders, the rich substances of the Marxist
Wednesday, May 6, 2020
The Theory of Platoââ¬â¢s Ideas Free Essays
Does Plato Believe There can ever be a Just Society In answering this question I first need to describe what a just society would consist of. A perfect state can only be lead under perfect conditions. Civil Society would be a better name for this state. We will write a custom essay sample on The Theory of Platoââ¬â¢s Ideas or any similar topic only for you Order Now A just state would be made up of three parts. First, a state is a structure with parts that work together like an organism. If the parts do not work well together then the whole thing breaks down. It must have virtues, voices, it can be wise and brave. The state must have everyone performing there jobs to their best ability. For a state to be just the people within the state must also be just. A man is just when he has a well ordered soul because then you will do the right thing by performing good and just actions. A soul must be allowed to perform its proper function. In a state you cannot define justice by a man because a man can decay into ugliness. Instead you must define justice based on forms. Plato says that the forms are eternal and ever lasting. What constitutes an unjust society is a lack of knowledge. So ignored to create a just society we must educate people. The society must be well rounded in their education for if they are not they will have problems in society. A society must be fit, participation in athletics, they need to be sensitive to prose poetry, and have knowledge of mathematics and science. Education can not be on specialties, but everything mind, spirit, and body. Having a well rounded education will help people to communicate in all areas. The more you know in many different areas the better over all communication a society has. One of the reason there are inequalities in a society is due to lack of knowledge. Everyone in the society must to some extent be a philosopher because they seek education and knowledge. A just society must also have a just ruler. A just ruler would need to be a philosopher, he would have to offer honest leadership which reflects the will and knowledge of society. A perfect society must have temperance, knowledge, and wisdom. In justices occur because of a lack of knowledge resulting in greed. In order to get rid of injustice everyone in the society must be educated starting at birth. Women and men need to be equally educated in a well rounded fashion in order to promote a just society. In asking if this society could ever work the answer is no. The only way it could work is if all of society is willing to accept knowledge and work hard for education. Even though there is no such thing as a truly unjust society a totally just society will never happen until people are willing to work for it. Another reason there can never be a perfectly just society is because everyoneâ⬠s perception of just is different. We know that the idea of justice is there, but to explain it to where everyone agrees to the idea would be hard to achieve. However, in trying to find true justice the society becomes stronger and more just. Expressing individuality that benefits or hurts a society however, reflects assertiveness, incentive, thought, and creativity, which strengthens the society. If a society ever got to the point of being just, the society would no longer have greed, drive for a better life, it would not have poverty or wealth. The society would just stop. There would be no more invention, growth, or change. The only change from Platoâ⬠s time to ours is technology. We are still searching for the perfect government, the question of who is better than who is still asked, and education is still a major principle to whether or not you are successful. How to cite The Theory of Platoââ¬â¢s Ideas, Papers
Thursday, April 30, 2020
THE EARTH SUN AND OTHER STUFF Essay Example For Students
THE EARTH SUN AND OTHER STUFF Essay WHAT CAUSES DAY AND NIGHT ON EARTH? AT THE EQUATOR EARTH ROTATES AT A SPEED OF 1600 KPH (KILOMETERS PER HOUR) IT TAKES EARTH 24 HOURS TO ROTATE ONCE ON ITS AXIS SO THE AMOUNT OF TIME ON EARTH TAKES TO COMPLETE ONE ROTATION IS A DAY,ONE ROTATION ONE DAY 24 HOURS LONG GOT IT? AS EARTH ROTATES PART OF IT FACES THE SUN AND THE OTHER DOES NOT MAKING THAT SIDE NIGHT AND THE PART FACING THE SUN DAY, SO IF IT TAKE THE EARTH TO ROTATE ON ITS AXIS IN 24 HOURS THERE WOULD BE 12 HOURS DAY AND 12 HOURS NIGHT , FROM SUNRISE TO SUNSET GOT THAT? A YEAR ON EARTH IS 365.26 DAYS WOWIE! IT SURE DOESNT FEEL LIKE THAT MANY DAYS BUT I GUESS IT WOULD TAKE THAT LONG TO MAKE A COMPLETE ROTATION AROUND THE ENORMOUS SUN, HOW ENORMOUS 1.35 KILOMETERS IN DIAMETER , 1 MILLION EARTHS COULD FIT INSIDE IT,BUT IF YOU THINK THE SUN IS HOLLOW OH BOY YOU WRONG THERE IS FOUR LAYERS OF THIS BIG BALL OF HOT BURNING GAS WHICH THEY ARE CALLED THE CORE WHICH IS THE CENTER OF THE SUN,THE PHOTOSPHERE WHICH IS THE INNERMOST LAYER ,THE CHROMOSPHERE WHICH IS THE LAYER BELOW THE CORONA,AND LAST BUT NOT LEAST THE CORONA THE OUTERMOST LAYER OF THE SUN. We will write a custom essay on THE EARTH SUN AND OTHER STUFF specifically for you for only $16.38 $13.9/page Order now YOU MIGHT KNOW OF THE AURORA WHICH IS BANDS OF SHIMMERING COLORED LIGHT WHICH IS CAUSED BY SOLAR WIND PARTICLES AND THE PARTICLES FROM THE SUN COLLIDING WITH THE EARTHS MAGNETOSPHERE MAKING A BEAUTIFUL DANCE OF LIGHTS.GALILEO GALILEI WAS THE FIRST PERSON TO LOOK AT THE MOON WITH HIS TELESCOPE,HE SAW HIGHLANDS, MOUNTAIN RANGES ON THE MOON,HE SAW BROAD LOWLAND PLAINS WHICH HE CALLED MARIA A LATIN WORD FOR SEAS SINCE HE THOUGHT IT WAS WATER THE DARK AREAS HE SEEN.HE ALSO SAW RILLES -ACTIVE VOLCANOES ,OR LONG VALLEYS.
Saturday, March 21, 2020
Fish Cheeks vs. Its Hard Enough Being Me
Fish Cheeks vs. Its Hard Enough Being Me In the new wave of globalization, movement across borders has become the norm. Most importantly, children often find themselves in unfamiliar territories when their parents relocate to other countries. In such situations, they experience cultural identity confusion as they try to redefine their identity amidst conflicting cultures. However, while redefining identity may attract challenges for adults, it is quite daunting for children and youths; since they are already struggling with developmental identity crisis.Advertising We will write a custom essay sample on ââ¬Å"Fish Cheeksâ⬠vs. ââ¬Å"Itââ¬â¢s Hard Enough Being Meâ⬠specifically for you for only $16.05 $11/page Learn More On the same note, Amy Tan ââ¬Å"Fish Cheeksâ⬠and Anna Raya ââ¬Å"Itââ¬â¢s Hard Enough Being Meâ⬠essays explore the subject of cultural identity struggle from the perspective of young people, who find themselves at cultural cross-roads in foreign soils . Against this milieu, this essay will provide a critical analysis of the two essays in an attempt to bring out the similarities and differences therein. To begin with, Raya finds herself in New York in pursuit of a university degree at the Columbia University. While here, she undergoes an array of conflicting experiences as she tries to redefine her identity amidst numerous occasions of misidentification. Although Raya has always identified herself with her Mexican and some Puerto Rican roots, she is thrown into identity confusion when her peers regard her as a ââ¬Å"Latinaâ⬠(Raya 1010). Due to this label, peers expect her to have a grasp of Spanish language, know how to dance salsa, and be knowledgeable about Mexican history. However, Raya confesses that she knew none of those things (Raya 1010). Correspondingly, in ââ¬Ëââ¬â¢Fish Cheeksâ⬠Tan exposes the struggle she endured while growing up in America as a Chinese teenager. Tan was always embarrassed about her background, and to some extent she perceived her traditional family as primitive (Raya 102). During teenage, individuals are always struggling with identity issues. Consequently, these two stories clearly depict that for young people, redefining identities in multicultural surroundings can be quite strenuous. On the same note, isolation and loneliness themes are constantly featured in these two stories. When circumstances compel Raya and Tan to grow up alongside white American culture, the feelings of isolation becomes inevitable. Raya (1010) confesses that her peers expected her to exhibit some aura of ââ¬Å"Latin-nessââ¬â¢Ã¢â¬â¢. Similarly, Tan avoids interacting with her peers because she is embarrassed of her Chinese roots. As a result, she avoided situations that could compel her to reveal her ââ¬Ëtaintedââ¬â¢ culture. (Tan 102). Although Tanââ¬â¢s embarrassment can be attributed to teenage-hood issues; she clearly confesses that she wished she had ââ¬Ëa slim American noseââ¬â¢ that would enable her to be regarded as a Native American (Tan 102). Noticeably, the two authors do not mention about their interaction with people outside their respective culture. Obviously, this insinuates that identity crisis is coupled with feeling of loneliness.Advertising Looking for essay on american literature? Let's see if we can help you! Get your first paper with 15% OFF Learn More Furthermore, isolation as a result of cultural identity disparities is clearly accentuated in ââ¬Å"Itââ¬â¢s Hard Enough Being Me.â⬠The above title indicates that cultural identity is a complex phenomenon that is often challenging to most people. However, it becomes even harder when one is forced to coexist with individuals who portray little or no element of cultural empathy. Raya feels isolated because her peers associate her with a culture she knows little about. Interestingly though, after a long struggle with cultural identity confus ion, Raya and Tan successfully reconciles with their rich heritage. Eventually, Raya realizes that trying to conform to the American culture only brought pain, loneliness and unhappiness to her life. Therefore in order to eliminate feelings of inadequacy and unhappiness, she decides to pass herself off as a woman with a rich heritage rather than trying to imitate American culture (Raya1011). Contrastingly, the protagonists in these two stories portray some element of diversity. Although Ray is caught up between cultural identity dilemmas, she is not embarrassed with her past. As a matter of fact, she is angered because her peers do not seem to understand the difference between her Mexican/ Puerto Rican and Latina background. Her only concern is that she is associated with a culture she knows little about. Contrastingly, Tan perceives her Chinese background as embarrassing. She is embarrassed about the way her family celebrates Christmas. Most importantly, when her parents invite a w hite family for Christmas dinner, she is angered because she assumes that they would definitely find their Chinese meals and mannerism disgusting (Tan 103). She confesses that she wished to ââ¬Ëdisappearââ¬â¢ rather than undergo those ââ¬Ëembarrassingââ¬â¢ moments, when ministerââ¬â¢s family would interact with their ââ¬Å"shabbyâ⬠culture (Tan 103). The above analysis depicts that unlike Raya, Tan wished to be regarded as an American instead of being associated with Chinese roots, which she perceived as embarrassing and primitive. In a nutshell, Rayaââ¬â¢s and Tanââ¬â¢s essays depict numerous similarities than differences. Inspired by the concept of cultural identity, the two authors explored themes of isolation and loneliness from a young personââ¬â¢s perspective. Rayaââ¬â¢s cultural confusion arises when peer pressure compels her to behave like a Latin native while in real sense she is of Mexican/ Puerto Rican origin. However, while Tan is seeming ly embarrassed by her Chinese background, Raya is proud of her roots. Raya, Anna Lisa. ââ¬Å"Itââ¬â¢s Hard enough Being Me.â⬠Literature and Composition. Ed. Sylvan Barnett et al. 6th ed. New York: Longman, 2003. 1010-1011. Print.Advertising We will write a custom essay sample on ââ¬Å"Fish Cheeksâ⬠vs. ââ¬Å"Itââ¬â¢s Hard Enough Being Meâ⬠specifically for you for only $16.05 $11/page Learn More Tan, Amy. ââ¬Å"Fish Cheeks.â⬠. Amy Tan: a literary companion. Ed. Mary Ellen Snodgrass. London: McFarland, 2004. 102-103. Print.
Wednesday, March 4, 2020
The Dark Side of Application.ProcessMessages
The Dark Side of Application.ProcessMessages Article submitted by Marcus Junglas When programming an event handler in Delphi (like the OnClick event of a TButton), there comes the time when your application needs to be busy for a while, e.g. the code needs to write a big file or compress some data. If you do that youll notice that your application seems to be locked. Your form cannot be moved anymore and the buttons are showing no sign of life. It seems to be crashed. The reason is that a Delpi application is single threaded. The code you are writing represents just a bunch of procedures which are called by Delphis main thread whenever an event occured. The rest of the time the main thread is handling system messages and other things like form and component handling functions. So, if you dont finish your event handling by doing some lengthy work, you will prevent the application to handle those messages. A common solution for such type of problems is to call Application.ProcessMessages. Application is a global object of the TApplication class. The Application.Processmessages handles all waiting messages like window movements, button clicks and so on. It is commonly used as a simple solution to keep your application working. Unfortunately the mechanism behind ProcessMessages has its own characteristics, which might cause big confusion! What does ProcessMessages? PprocessMessages handles all waiting system messages in the applications message queue. Windows uses messages to talk to all running applications. User interaction is brought to the form via messages and ProcessMessages handles them. If the mouse is going down on a TButton, for example, ProgressMessages does all what should happen on this event like the repaint of the button to a pressed state and, of course, a call to the OnClick() handling procedure if you assigned one. Thats the problem: any call to ProcessMessages might contain a recursive call to any event handler again. Heres an example: Use the following code for a buttons OnClick even handler (work). The for-statement simulates a long processing job with some calls to ProcessMessages every now and then. This is simplified for better readability: {in MyForm:} à à WorkLevel : integer; {OnCreate:} à à WorkLevel : 0; procedure TForm1.WorkBtnClick(Sender: TObject) ; var à à cycle : integer; begin à à inc(WorkLevel) ; à à for cycle : 1 to 5 do à à begin à à à à Memo1.Lines.Add(- Work IntToStr(WorkLevel) , Cycle IntToStr(cycle) ; à à à à Application.ProcessMessages; à à à à sleep(1000) ; // or some other work à à end; à à Memo1.Lines.Add(Work IntToStr(WorkLevel) ended.) ; à à dec(WorkLevel) ; end; WITHOUT ProcessMessages the following lines are written to the memo, if the Button was pressed TWICE in a short time: - Work 1, Cycle 1 - Work 1, Cycle 2 - Work 1, Cycle 3 - Work 1, Cycle 4 - Work 1, Cycle 5 Work 1 ended. - Work 1, Cycle 1 - Work 1, Cycle 2 - Work 1, Cycle 3 - Work 1, Cycle 4 - Work 1, Cycle 5 Work 1 ended. While the procedure is busy, the the form does not show any reaction, but the second click was put into the message queue by Windows. Right after the OnClick has finished it will be called again. INCLUDING ProcessMessages, the output might be very different: - Work 1, Cycle 1 - Work 1, Cycle 2 - Work 1, Cycle 3 - Work 2, Cycle 1 - Work 2, Cycle 2 - Work 2, Cycle 3 - Work 2, Cycle 4 - Work 2, Cycle 5 Work 2 ended. - Work 1, Cycle 4 - Work 1, Cycle 5 Work 1 ended. This time the form seems to be working again and accepts any user interaction. So the button is pressed half way during your first worker function AGAIN, which will be handled instantly. All incoming events are handled like any other function call. In theory, during every call to ProgressMessages ANY amount of clicks and user messages might happen in place. So be careful with your code! Different example (in simple pseudo-code!): procedure OnClickFileWrite() ; var myfile : TFileStream; begin à à myfile : TFileStream.create(myOutput.txt) ; à à try à à à à while BytesReady 0 do à à à à begin à à à à à à myfile.Write(DataBlock) ; à à à à à à dec(BytesReady,sizeof(DataBlock)) ; à à à à à à DataBlock[2] : #13; {test line 1} à à à à à à Application.ProcessMessages; à à à à à à DataBlock[2] : #13; {test line 2} à à à à end; à à finally à à à à myfile.free; à à end; end; This function writes a large amount of data and tries to unlock the application by using ProcessMessages each time a block of data is written. If the user clicks on the button again, the same code will be executed while the file is still being written to. So the file cannot be opened a 2nd time and the procedure fails. Maybe your application will do some error recovery like freeing the buffers. As a possible result Datablock will be freed and the first code will suddenly raise an Access Violation when it accesses it. In this case: test line 1 will work, test line 2 will crash. The better way: To make it easy you could set the whole Form enabled : false, which blocks all user input, but does NOT show this to the user (all Buttons are not grayed). A better way would be to set all buttons to disabled, but this might be complex if you want to keep one Cancel button for example. Also you need to go through all the components to disable them and when they are enabled again, you need to check if there should be some remaining in the disabled state. You could disable a container child controls when the Enabled property changes. As the class name TNotifyEvent suggests, it should only be used for short term reactions to the event. For time consuming code the best way is IMHO to put all the slow code into an own Thread. Regarding the problems with PrecessMessages and/or the enabling and disabling of components, the usage of a second thread seems to be not too complicated at all. Remember that even simple and fast lines of code might hang for seconds, e.g. opening a file on a disc drive might have to wait until the drive spin up has finished. It doesnt look very good if your application seem to crash because the drive is too slow. Thats it. The next time you add Application.ProcessMessages, think twice ;)
Subscribe to:
Posts (Atom)